- Make sure we clear the additional railtype bit only for the correct tiles.

- Backup and restore the correct railtype for tiles when newGRFs are reloaded during a game.

(cherry picked from commit f5bf8e69b4fe95519513b934dc1057dc304ce3da)
This commit is contained in:
keldorkatarn
2016-04-02 18:41:04 +02:00
committed by Jonathan G Rennison
parent 4c37aad393
commit 75396c9b5f
2 changed files with 47 additions and 5 deletions

View File

@@ -14,6 +14,7 @@
#include "bridge_map.h"
#include "tunnel_map.h"
#include "cmd_helper.h"
/**
@@ -57,6 +58,19 @@ static inline bool HasTunnelBridgeSnowOrDesert(TileIndex t)
return HasBit(_me[t].m7, 5);
}
/**
* Is this a rail bridge or tunnel?
* @param t the tile that might be a rail bridge or tunnel
* @return true if and only if this tile is a rail bridge or tunnel
*/
static inline bool IsRailTunnelBridgeTile(TileIndex t)
{
TransportType tt = Extract<TransportType, 2, 2>(_m[t].m5);
return IsTileType(t, MP_TUNNELBRIDGE) && (tt == TRANSPORT_RAIL);
}
/**
* Tunnel: Places this tunnel entrance in a snowy or desert area, or takes it out of there.
* Bridge: Sets whether the bridge ramp lies in a snow or desert area.