mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 15:41:15 +00:00
(svn r8485) -Fix
-Fix (since the dawn of time): Remove phantom oil rigs sometimes present in old savegames
This commit is contained in:
parent
f5d74b8af6
commit
63a5b0e8be
@ -28,7 +28,6 @@
|
||||
|
||||
void ShowIndustryViewWindow(int industry);
|
||||
void BuildOilRig(TileIndex tile);
|
||||
void DeleteOilRig(TileIndex tile);
|
||||
|
||||
static byte _industry_sound_ctr;
|
||||
static TileIndex _industry_sound_tile;
|
||||
|
@ -1302,6 +1302,19 @@ bool AfterLoadGame(void)
|
||||
}
|
||||
break;
|
||||
|
||||
case STATION_OILRIG: {
|
||||
/* Very old savegames sometimes have phantom oil rigs, i.e.
|
||||
* an oil rig which got shut down, but not completly removed from
|
||||
* the map
|
||||
*/
|
||||
TileIndex t1 = TILE_ADDXY(t, 1, 0);
|
||||
if (!IsTileType(t1, MP_INDUSTRY) ||
|
||||
GetIndustryGfx(t1) != GFX_OILRIG_3) {
|
||||
DeleteOilRig(t);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
|
@ -277,4 +277,6 @@ static inline bool IsBuoy(const Station* st)
|
||||
return (st->had_vehicle_of_type & HVOT_BUOY) != 0; /* XXX: We should really ditch this ugly coding and switch to something sane... */
|
||||
}
|
||||
|
||||
void DeleteOilRig(TileIndex t);
|
||||
|
||||
#endif /* STATION_H */
|
||||
|
Loading…
Reference in New Issue
Block a user