From 244d4ab5cbbd578d24654f83b67d7d0047043535 Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 30 Jan 2006 17:18:45 +0000 Subject: (svn r3490) -Fix: A bunch (10) of off-by-one errors when checking if a TileIndex points to a tile on the map --- tunnelbridge_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tunnelbridge_cmd.c') 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 -- cgit v1.2.3-54-g00ecf