diff --git a/tree_cmd.c b/tree_cmd.c --- a/tree_cmd.c +++ b/tree_cmd.c @@ -265,7 +265,7 @@ int32 CmdPlantTree(TileIndex tile, uint3 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 t { 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);