(svn r19455) -Codechange: split all airport information in Station to a seperate class

This commit is contained in:
yexo
2010-03-18 21:02:20 +00:00
parent 0eb5709c86
commit c4a88ce022
23 changed files with 100 additions and 97 deletions

View File

@@ -732,11 +732,11 @@ static const OldChunks station_chunk[] = {
OCL_SVAR( OC_UINT8, Station, delete_ctr ),
OCL_SVAR( OC_UINT8, Station, owner ),
OCL_SVAR( OC_UINT8, Station, facilities ),
OCL_SVAR( OC_TTD | OC_UINT8, Station, airport_type ),
OCL_SVAR( OC_TTO | OC_FILE_U16 | OC_VAR_U64, Station, airport_flags ),
OCL_SVAR( OC_TTD | OC_UINT8, Station, airport.type ),
OCL_SVAR( OC_TTO | OC_FILE_U16 | OC_VAR_U64, Station, airport.flags ),
OCL_NULL( 3 ), ///< bus/truck status, blocked months, no longer in use
OCL_CNULL( OC_TTD, 1 ), ///< unknown
OCL_SVAR( OC_TTD | OC_FILE_U16 | OC_VAR_U64, Station, airport_flags ),
OCL_SVAR( OC_TTD | OC_FILE_U16 | OC_VAR_U64, Station, airport.flags ),
OCL_CNULL( OC_TTD, 2 ), ///< last_vehicle. now last_vehicle_type
OCL_CNULL( OC_TTD, 4 ), ///< junk at end of chunk
@@ -760,12 +760,12 @@ static bool LoadOldStation(LoadgameState *ls, int num)
st->string_id = _old_string_id + 0x2800; // custom name
}
if (HasBit(st->airport_flags, 8)) {
st->airport_type = 1; // large airport
} else if (HasBit(st->airport_flags, 6)) {
st->airport_type = 3; // oil rig
if (HasBit(st->airport.flags, 8)) {
st->airport.type = 1; // large airport
} else if (HasBit(st->airport.flags, 6)) {
st->airport.type = 3; // oil rig
} else {
st->airport_type = 0; // small airport
st->airport.type = 0; // small airport
}
} else {
st->string_id = RemapOldStringID(_old_string_id);