(svn r14955) -Fix: newgrf station specs didn't get deallocated when building a new station part over them.

This commit is contained in:
rubidium 2009-01-10 14:01:17 +00:00
parent 7878405a12
commit 1b546505d2
1 changed files with 4 additions and 0 deletions

View File

@ -1099,7 +1099,11 @@ CommandCost CmdBuildRailroadStation(TileIndex tile_org, uint32 flags, uint32 p1,
}
}
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 */
DeallocateSpecFromStation(st, old_specindex);
SetCustomStationSpecIndex(tile, specindex);
SetStationTileRandomBits(tile, GB(Random(), 0, 4));
SetStationAnimationFrame(tile, 0);