(svn r16709) -Fix [FS#2994]: the list of animated tiles could have duplicates (only for old savegames) and tiles that weren't animated

This commit is contained in:
rubidium
2009-07-01 14:51:05 +00:00
parent 8db99f57f8
commit 927c4a0fe8
5 changed files with 37 additions and 1 deletions

View File

@@ -1003,6 +1003,8 @@ CommandCost CmdBuildRailroadStation(TileIndex tile_org, DoCommandFlag flags, uin
}
}
/* Remove animation if overbuilding */
DeleteAnimatedTile(tile);
byte old_specindex = IsTileType(tile, MP_STATION) ? GetCustomStationSpecIndex(tile) : 0;
MakeRailStation(tile, st->owner, st->index, axis, layout & ~1, (RailType)GB(p1, 0, 4));
/* Free the spec if we overbuild something */
@@ -2948,6 +2950,7 @@ void BuildOilRig(TileIndex tile)
st->string_id = GenerateStationName(st, tile, STATIONNAMING_OILRIG);
assert(IsTileType(tile, MP_INDUSTRY));
DeleteAnimatedTile(tile);
MakeOilrig(tile, st->index, GetWaterClass(tile));
st->owner = OWNER_NONE;