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 | 4c9d9a87f18191ae9ae4368176c96b89dd172c8f (patch) | |
tree | 52f21281bd10b45ef340a15357a04bf130b9b554 /misc_cmd.c | |
parent | 2380bb56cd4a25eef126153bb6b5ccde8222fc5c (diff) | |
download | openttd-4c9d9a87f18191ae9ae4368176c96b89dd172c8f.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 */ |