(svn r12363) -Fix: do not allow building 'zero' road bits

This commit is contained in:
smatz 2008-03-12 18:10:45 +00:00
parent 84385f187b
commit 902320d7cb
1 changed files with 3 additions and 0 deletions

View File

@ -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;