diff options
author | Darkvater <darkvater@openttd.org> | 2006-10-14 22:31:18 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-10-14 22:31:18 +0000 |
commit | 6b6d908308c9aaf32f7b99500715319aaab1a51c (patch) | |
tree | 52f21281bd10b45ef340a15357a04bf130b9b554 /misc_cmd.c | |
parent | 9732c129c16dea48e69188b75c2e39f9faacf86f (diff) | |
download | openttd-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 'misc_cmd.c')
-rw-r--r-- | misc_cmd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/misc_cmd.c b/misc_cmd.c index 342cbbbe3..4293706ba 100644 --- a/misc_cmd.c +++ b/misc_cmd.c @@ -291,7 +291,7 @@ int32 CmdGiveMoney(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) /* You can only transfer funds that is in excess of your loan */ if (p->money64 - p->current_loan < amount || amount <= 0) return CMD_ERROR; - if (!_networking || p2 >= MAX_PLAYERS) return CMD_ERROR; + if (!_networking || !IsValidPlayer((PlayerID)p2)) return CMD_ERROR; if (flags & DC_EXEC) { /* Add money to player */ |