diff options
author | tron <tron@openttd.org> | 2006-01-30 17:18:45 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-01-30 17:18:45 +0000 |
commit | 5e1e90260016fc5ad7a62a824922f9766158bbf8 (patch) | |
tree | a71bfa3b7016eec2f35802faea7d5bb51c9b0130 /tunnelbridge_cmd.c | |
parent | c8dd64bdbc162753f55b06ad395c84d15bff6998 (diff) | |
download | openttd-5e1e90260016fc5ad7a62a824922f9766158bbf8.tar.xz |
(svn r3490) -Fix: A bunch (10) of off-by-one errors when checking if a TileIndex points to a tile on the map
Diffstat (limited to 'tunnelbridge_cmd.c')
-rw-r--r-- | tunnelbridge_cmd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c index 02829af96..fe6dae18d 100644 --- a/tunnelbridge_cmd.c +++ b/tunnelbridge_cmd.c @@ -209,7 +209,7 @@ int32 CmdBuildBridge(int x, int y, uint32 flags, uint32 p1, uint32 p2) bridge_type = GB(p2, 0, 8); railtype = GB(p2, 8, 8); - if (p1 > MapSize()) return CMD_ERROR; + if (p1 >= MapSize()) return CMD_ERROR; // type of bridge if (HASBIT(railtype, 7)) { // bit 15 of original p2 param |