Changeset - r19608:2f6e3673e388
[Not reviewed]
master
0 1 0
yexo - 12 years ago 2012-09-21 20:28:23
yexo@openttd.org
(svn r24539) -Codechange [FS#5260]: make code simpler by using IsValidTile instead of manually checking the bounds (juanjo)
1 file changed with 2 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/ship_cmd.cpp
Show inline comments
 
@@ -570,15 +570,12 @@ static void ShipController(Ship *v)
 
				}
 
			}
 
		} else {
 
			DiagDirection diagdir;
 
			/* New tile */
 
			if (TileX(gp.new_tile) >= MapMaxX() || TileY(gp.new_tile) >= MapMaxY()) {
 
				goto reverse_direction;
 
			}
 
			if (!IsValidTile(gp.new_tile)) goto reverse_direction;
 

	
 
			dir = ShipGetNewDirectionFromTiles(gp.new_tile, gp.old_tile);
 
			assert(dir == DIR_NE || dir == DIR_SE || dir == DIR_SW || dir == DIR_NW);
 
			diagdir = DirToDiagDir(dir);
 
			DiagDirection diagdir = DirToDiagDir(dir);
 
			tracks = GetAvailShipTracks(gp.new_tile, diagdir);
 
			if (tracks == TRACK_BIT_NONE) goto reverse_direction;
 

	
0 comments (0 inline, 0 general)