forked from mirror/OpenTTD
(svn r2142) - Fix: Game no longer crashes when you want to remove a piece of road under a bridge that belongs to the town. TODO: railcrossings store owner somewhere else, put it into _map_owner[]!
This commit is contained in:
@@ -1807,8 +1807,15 @@ Town *ClosestTownFromTile(uint tile, uint threshold)
|
||||
Town *t;
|
||||
uint dist, best = threshold;
|
||||
Town *best_town = NULL;
|
||||
byte owner;
|
||||
|
||||
if ((IsTileType(tile, MP_STREET) && _map_owner[tile] == OWNER_TOWN) || IsTileType(tile, MP_HOUSE))
|
||||
// XXX - Fix this so for a given tiletype the owner of the type is in the same variable
|
||||
if (IsTileType(tile, MP_STREET) && (_map5[tile] & 0xF0) == 0x10) { // rail crossing
|
||||
owner = _map3_lo[tile];
|
||||
} else
|
||||
owner = _map_owner[tile];
|
||||
|
||||
if ((IsTileType(tile, MP_STREET) && owner == OWNER_TOWN) || IsTileType(tile, MP_HOUSE))
|
||||
return GetTown(_map2[tile]);
|
||||
|
||||
FOR_ALL_TOWNS(t) {
|
||||
|
Reference in New Issue
Block a user