From 4c9d9a87f18191ae9ae4368176c96b89dd172c8f Mon Sep 17 00:00:00 2001 From: Darkvater Date: Sat, 14 Oct 2006 22:31:18 +0000 Subject: (svn r6776) -Codechange: Use IsValidPlayer() function to determine of a PlayerID is an actual playable player (< MAX_PLAYERS) or not. --- misc_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'misc_cmd.c') 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 */ -- cgit v1.2.3-54-g00ecf