summaryrefslogtreecommitdiff
path: root/src/road_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-09-07 11:23:10 +0000
committerrubidium <rubidium@openttd.org>2008-09-07 11:23:10 +0000
commit6e67ea1f9dac718ec58d54b73883b0dd043bff2d (patch)
tree94706b006a8848169482c99bfbb9ca6f9c734954 /src/road_cmd.cpp
parent466e7740d71bb76ed96d3509e8b987e1ed9019bb (diff)
downloadopenttd-6e67ea1f9dac718ec58d54b73883b0dd043bff2d.tar.xz
(svn r14258) -Codechange: rework the way to query the vehicle hash to make sure it always results in the same irregardless of the order of the hash-linked-list.
-Fix: desync in PBS reservation following, vehicle flooding and road vehicle overtake/follow code.
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r--src/road_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 44a0ae854..cea81bca7 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -223,7 +223,7 @@ static CommandCost RemoveRoad(TileIndex tile, uint32 flags, RoadBits pieces, Roa
case MP_TUNNELBRIDGE:
if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) return CMD_ERROR;
- if (GetVehicleTunnelBridge(tile, GetOtherTunnelBridgeEnd(tile)) != NULL) return CMD_ERROR;
+ if (HasVehicleOnTunnelBridge(tile, GetOtherTunnelBridgeEnd(tile))) return CMD_ERROR;
break;
default:
@@ -589,7 +589,7 @@ CommandCost CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (MirrorRoadBits(DiagDirToRoadBits(GetTunnelBridgeDirection(tile))) != pieces) return CMD_ERROR;
if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
/* Don't allow adding roadtype to the bridge/tunnel when vehicles are already driving on it */
- if (GetVehicleTunnelBridge(tile, GetOtherTunnelBridgeEnd(tile)) != NULL) return CMD_ERROR;
+ if (HasVehicleOnTunnelBridge(tile, GetOtherTunnelBridgeEnd(tile))) return CMD_ERROR;
break;
default: {