diff options
author | smatz <smatz@openttd.org> | 2008-03-12 18:10:45 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-03-12 18:10:45 +0000 |
commit | 902320d7cb79f0b75ea404dcdd3958519c28eaa7 (patch) | |
tree | f700545436b51714da4f903a4351a8a6ec1ba661 | |
parent | 84385f187b2f8d99366a56fa57d487627056d315 (diff) | |
download | openttd-902320d7cb79f0b75ea404dcdd3958519c28eaa7.tar.xz |
(svn r12363) -Fix: do not allow building 'zero' road bits
-rw-r--r-- | src/road_cmd.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 356d11335..0f321dfb6 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -414,6 +414,9 @@ CommandCost CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) RoadBits pieces = Extract<RoadBits, 0>(p1); + /* do not allow building 'zero' road bits, code wouldn't handle it */ + if (pieces == ROAD_NONE) return CMD_ERROR; + RoadType rt = (RoadType)GB(p1, 4, 2); if (!IsValidRoadType(rt) || !ValParamRoadType(rt)) return CMD_ERROR; |