mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-07 06:46:43 +00:00
(svn r8498) -Fix
-Codechange: Move the update of the oil rig airport type to the recently (r8485) added loop
This commit is contained in:
parent
c5c0a54a50
commit
ce12ae7420
@ -2041,14 +2041,6 @@ void Aircraft_Tick(Vehicle *v)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateOilRig(void)
|
|
||||||
{
|
|
||||||
Station* st;
|
|
||||||
|
|
||||||
FOR_ALL_STATIONS(st) {
|
|
||||||
if (st->airport_type == 5) st->airport_type = AT_OILRIG;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// need to be called to load aircraft from old version
|
// need to be called to load aircraft from old version
|
||||||
void UpdateOldAircraft(void)
|
void UpdateOldAircraft(void)
|
||||||
@ -2060,8 +2052,6 @@ void UpdateOldAircraft(void)
|
|||||||
// set airport_flags to 0 for all airports just to be sure
|
// set airport_flags to 0 for all airports just to be sure
|
||||||
FOR_ALL_STATIONS(st) {
|
FOR_ALL_STATIONS(st) {
|
||||||
st->airport_flags = 0; // reset airport
|
st->airport_flags = 0; // reset airport
|
||||||
// type of oilrig has been moved, update it (3-5)
|
|
||||||
if (st->airport_type == 3) st->airport_type = AT_OILRIG;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FOR_ALL_VEHICLES(v_oldstyle) {
|
FOR_ALL_VEHICLES(v_oldstyle) {
|
||||||
|
@ -1154,7 +1154,6 @@ static void UpdateSignOwner(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern void UpdateOldAircraft( void );
|
extern void UpdateOldAircraft( void );
|
||||||
extern void UpdateOilRig( void );
|
|
||||||
|
|
||||||
|
|
||||||
static inline RailType UpdateRailType(RailType rt, RailType min)
|
static inline RailType UpdateRailType(RailType rt, RailType min)
|
||||||
@ -1278,9 +1277,6 @@ bool AfterLoadGame(void)
|
|||||||
DoZoomInOutWindow(ZOOM_NONE, w); // update button status
|
DoZoomInOutWindow(ZOOM_NONE, w); // update button status
|
||||||
MarkWholeScreenDirty();
|
MarkWholeScreenDirty();
|
||||||
|
|
||||||
// In 5.1, Oilrigs have been moved (again)
|
|
||||||
if (CheckSavegameVersionOldStyle(5, 1)) UpdateOilRig();
|
|
||||||
|
|
||||||
/* From this version on there can be multiple road stops of the same type per
|
/* From this version on there can be multiple road stops of the same type per
|
||||||
* station. Convert the existing stops to the new internal data structure.
|
* station. Convert the existing stops to the new internal data structure.
|
||||||
*/
|
*/
|
||||||
@ -1307,8 +1303,14 @@ bool AfterLoadGame(void)
|
|||||||
* the map
|
* the map
|
||||||
*/
|
*/
|
||||||
TileIndex t1 = TILE_ADDXY(t, 1, 0);
|
TileIndex t1 = TILE_ADDXY(t, 1, 0);
|
||||||
if (!IsTileType(t1, MP_INDUSTRY) ||
|
if (IsTileType(t1, MP_INDUSTRY) &&
|
||||||
GetIndustryGfx(t1) != GFX_OILRIG_3) {
|
GetIndustryGfx(t1) == GFX_OILRIG_3) {
|
||||||
|
/* The internal encoding of oil rigs was changed twice.
|
||||||
|
* It was 3 (till 2.2) and later 5 (till 5.1).
|
||||||
|
* Setting it unconditionally does not hurt.
|
||||||
|
*/
|
||||||
|
GetStationByTile(t)->airport_type = AT_OILRIG;
|
||||||
|
} else {
|
||||||
DeleteOilRig(t);
|
DeleteOilRig(t);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user