518 if (!AddBlockIfNeeded(&_Depot_pool, num)) |
518 if (!AddBlockIfNeeded(&_Depot_pool, num)) |
519 error("Depots: failed loading savegame: too many depots"); |
519 error("Depots: failed loading savegame: too many depots"); |
520 |
520 |
521 if (!LoadChunk(ls, GetDepot(num), depot_chunk)) return false; |
521 if (!LoadChunk(ls, GetDepot(num), depot_chunk)) return false; |
522 |
522 |
523 if (IsValidDepot(GetDepot(num))) { |
523 if (IsValidDepotID(num)) { |
524 GetDepot(num)->town_index = REMAP_TOWN_IDX(_old_town_index); |
524 GetDepot(num)->town_index = REMAP_TOWN_IDX(_old_town_index); |
525 } |
525 } |
526 |
526 |
527 return true; |
527 return true; |
528 } |
528 } |
713 error("Industries: failed loading savegame: too many industries"); |
713 error("Industries: failed loading savegame: too many industries"); |
714 |
714 |
715 i = GetIndustry(num); |
715 i = GetIndustry(num); |
716 if (!LoadChunk(ls, i, industry_chunk)) return false; |
716 if (!LoadChunk(ls, i, industry_chunk)) return false; |
717 |
717 |
718 if (IsValidIndustry(i)) { |
718 if (i->IsValid()) { |
719 i->town = GetTown(REMAP_TOWN_IDX(_old_town_index)); |
719 i->town = GetTown(REMAP_TOWN_IDX(_old_town_index)); |
720 } |
720 } |
721 |
721 |
722 return true; |
722 return true; |
723 } |
723 } |
1051 |
1051 |
1052 OCL_END() |
1052 OCL_END() |
1053 }; |
1053 }; |
1054 |
1054 |
1055 static const OldChunks vehicle_special_chunk[] = { |
1055 static const OldChunks vehicle_special_chunk[] = { |
1056 OCL_SVAR( OC_UINT16, VehicleSpecial, unk0 ), |
1056 OCL_SVAR( OC_UINT16, VehicleSpecial, animation_state ), |
1057 OCL_SVAR( OC_UINT8, VehicleSpecial, unk2 ), |
1057 OCL_SVAR( OC_UINT8, VehicleSpecial, animation_substate ), |
1058 |
1058 |
1059 OCL_NULL( 7 ), // Junk |
1059 OCL_NULL( 7 ), // Junk |
1060 |
1060 |
1061 OCL_END() |
1061 OCL_END() |
1062 }; |
1062 }; |
1063 |
1063 |
1064 static const OldChunks vehicle_disaster_chunk[] = { |
1064 static const OldChunks vehicle_disaster_chunk[] = { |
1065 OCL_SVAR( OC_UINT16, VehicleDisaster, image_override ), |
1065 OCL_SVAR( OC_UINT16, VehicleDisaster, image_override ), |
1066 OCL_SVAR( OC_UINT16, VehicleDisaster, unk2 ), |
1066 OCL_SVAR( OC_UINT16, VehicleDisaster, big_ufo_destroyer_target ), |
1067 |
1067 |
1068 OCL_NULL( 6 ), ///< Junk |
1068 OCL_NULL( 6 ), ///< Junk |
1069 |
1069 |
1070 OCL_END() |
1070 OCL_END() |
1071 }; |
1071 }; |