ai_pathfinder.c
changeset 1450 6bf299c74d88
parent 1330 5d76a0522a11
child 1459 19333d7f99b3
equal deleted inserted replaced
1449:df3ccdd9ee66 1450:6bf299c74d88
   212        			if (IsTileType(current->path.node.tile + TileOffsByDir(i), MP_TUNNELBRIDGE)) {
   212        			if (IsTileType(current->path.node.tile + TileOffsByDir(i), MP_TUNNELBRIDGE)) {
   213        				// An existing bridge... let's test the direction ;)
   213        				// An existing bridge... let's test the direction ;)
   214        				if ((_map5[current->path.node.tile + TileOffsByDir(i)] & 1U) != (i & 1)) continue;
   214        				if ((_map5[current->path.node.tile + TileOffsByDir(i)] & 1U) != (i & 1)) continue;
   215    					// This problem only is valid for tunnels:
   215    					// This problem only is valid for tunnels:
   216        				// When the last tile was not yet a tunnel, check if we enter from the right side..
   216        				// When the last tile was not yet a tunnel, check if we enter from the right side..
   217        				if (!IsTileType(current->path.node.tile, MP_TUNNELBRIDGE) && (_map5[current->path.node.tile + TileOffsByDir(i)] & 0x80) == 0) {
   217        				if ((_map5[current->path.node.tile + TileOffsByDir(i)] & 0x80) == 0) {
   218        					if (i != (_map5[current->path.node.tile + TileOffsByDir(i)] & 3U)) continue;
   218        					if (i != (_map5[current->path.node.tile + TileOffsByDir(i)] & 3U)) continue;
   219        				}
   219        				}
   220        			}
   220        			}
   221        		}
   221        		}
   222        		// But also if we are on a bridge, we can only move a certain direction
   222        		// But also if we are on a bridge, we can only move a certain direction