mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-26 07:59:09 +00:00
(svn r6776) -Codechange: Use IsValidPlayer() function to determine of a PlayerID is an
actual playable player (< MAX_PLAYERS) or not.
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user