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

pull/155/head
rubidium 16 years ago
parent 905631d9df
commit 2887ff3077

@ -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);

Loading…
Cancel
Save