summaryrefslogtreecommitdiff
path: root/road_cmd.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-10-14 22:31:18 +0000
committerDarkvater <darkvater@openttd.org>2006-10-14 22:31:18 +0000
commit6b6d908308c9aaf32f7b99500715319aaab1a51c (patch)
tree52f21281bd10b45ef340a15357a04bf130b9b554 /road_cmd.c
parent9732c129c16dea48e69188b75c2e39f9faacf86f (diff)
downloadopenttd-6b6d908308c9aaf32f7b99500715319aaab1a51c.tar.xz
(svn r6776) -Codechange: Use IsValidPlayer() function to determine of a PlayerID is an
actual playable player (< MAX_PLAYERS) or not.
Diffstat (limited to 'road_cmd.c')
-rw-r--r--road_cmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/road_cmd.c b/road_cmd.c
index 6ec8ef07f..7d6f5b0f2 100644
--- a/road_cmd.c
+++ b/road_cmd.c
@@ -45,7 +45,7 @@ static bool CheckAllowRemoveRoad(TileIndex tile, RoadBits remove, bool* edge_roa
if (_game_mode == GM_EDITOR) return true;
// Only do the special processing for actual players.
- if (_current_player >= MAX_PLAYERS) return true;
+ if (!IsValidPlayer(_current_player)) return true;
owner = IsLevelCrossingTile(tile) ? GetCrossingRoadOwner(tile) : GetTileOwner(tile);
@@ -289,7 +289,7 @@ int32 CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
/* Road pieces are max 4 bitset values (NE, NW, SE, SW) and town can only be non-zero
* if a non-player is building the road */
- if ((p1 >> 4) || (_current_player < MAX_PLAYERS && p2 != 0) || !IsValidTownID(p2)) return CMD_ERROR;
+ if ((p1 >> 4) || (IsValidPlayer(_current_player) && p2 != 0) || !IsValidTownID(p2)) return CMD_ERROR;
pieces = p1;
tileh = GetTileSlope(tile, NULL);