diff options
Diffstat (limited to 'tree_cmd.c')
-rw-r--r-- | tree_cmd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tree_cmd.c b/tree_cmd.c index 73ec5adbf..847b8971d 100644 --- a/tree_cmd.c +++ b/tree_cmd.c @@ -265,7 +265,7 @@ int32 CmdPlantTree(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) TreeType treetype; uint growth; - if (_game_mode != GM_EDITOR && _current_player < MAX_PLAYERS) { + if (_game_mode != GM_EDITOR && IsValidPlayer(_current_player)) { Town *t = ClosestTownFromTile(tile, _patches.dist_local_authority); if (t != NULL) ChangeTownRating(t, RATING_TREE_UP_STEP, RATING_TREE_MAXIMUM); @@ -415,7 +415,7 @@ static int32 ClearTile_Trees(TileIndex tile, byte flags) { uint num; - if (flags & DC_EXEC && _current_player < MAX_PLAYERS) { + if ((flags & DC_EXEC) && IsValidPlayer(_current_player)) { Town *t = ClosestTownFromTile(tile, _patches.dist_local_authority); if (t != NULL) ChangeTownRating(t, RATING_TREE_DOWN_STEP, RATING_TREE_MINIMUM); |