summaryrefslogtreecommitdiff
path: root/tree_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 /tree_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 'tree_cmd.c')
-rw-r--r--tree_cmd.c4
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);