summaryrefslogtreecommitdiff
path: root/src/tunnelbridge_cmd.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2008-01-03 23:50:58 +0000
committerglx <glx@openttd.org>2008-01-03 23:50:58 +0000
commit42bddcf723fdcabf6ea8d4069effc086710ef156 (patch)
tree026efa2300b2925d9151a9d24da6c7fc6329a271 /src/tunnelbridge_cmd.cpp
parentaebcd80088bfe4ecba84f37f55fbef1e4ffdb187 (diff)
downloadopenttd-42bddcf723fdcabf6ea8d4069effc086710ef156.tar.xz
(svn r11749) -Fix (r11352): when a bankrupted company is bought, reset vehicle color mapping so the vehicles use the new owner color
Diffstat (limited to 'src/tunnelbridge_cmd.cpp')
-rw-r--r--src/tunnelbridge_cmd.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index d1512baef..ec72c544f 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -599,16 +599,16 @@ static CommandCost DoClearTunnel(TileIndex tile, uint32 flags)
}
}
+ /* Adjust the town's player rating. Do this before removing the tile owner info. */
+ if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR)
+ ChangeTownRating(t, RATING_TUNNEL_BRIDGE_DOWN_STEP, RATING_TUNNEL_BRIDGE_MINIMUM);
+
if (flags & DC_EXEC) {
/* We first need to request the direction before calling DoClearSquare
* else the direction is always 0.. dah!! ;) */
DiagDirection dir = GetTunnelBridgeDirection(tile);
Track track;
- /* Adjust the town's player rating. Do this before removing the tile owner info. */
- if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR)
- ChangeTownRating(t, RATING_TUNNEL_BRIDGE_DOWN_STEP, RATING_TUNNEL_BRIDGE_MINIMUM);
-
DoClearSquare(tile);
DoClearSquare(endtile);
UpdateSignalsOnSegment(tile, ReverseDiagDir(dir));
@@ -650,15 +650,15 @@ static CommandCost DoClearBridge(TileIndex tile, uint32 flags)
}
}
+ /* checks if the owner is town then decrease town rating by RATING_TUNNEL_BRIDGE_DOWN_STEP until
+ * you have a "Poor" (0) town rating */
+ if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR)
+ ChangeTownRating(t, RATING_TUNNEL_BRIDGE_DOWN_STEP, RATING_TUNNEL_BRIDGE_MINIMUM);
+
if (flags & DC_EXEC) {
TileIndex c;
Track track;
- /* checks if the owner is town then decrease town rating by RATING_TUNNEL_BRIDGE_DOWN_STEP until
- * you have a "Poor" (0) town rating */
- if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR)
- ChangeTownRating(t, RATING_TUNNEL_BRIDGE_DOWN_STEP, RATING_TUNNEL_BRIDGE_MINIMUM);
-
DoClearSquare(tile);
DoClearSquare(endtile);
for (c = tile + delta; c != endtile; c += delta) {