diff --git a/src/economy.cpp b/src/economy.cpp --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1784,7 +1784,7 @@ CommandCost CmdBuyShareInCompany(TileInd /* Check if buying shares is allowed (protection against modified clients) */ /* Cannot buy own shares */ - if (!IsValidPlayer((PlayerID)p1) || !_settings_game.economy.allow_shares || _current_player == (PlayerID)p1) return CMD_ERROR; + if (!IsValidPlayerID((PlayerID)p1) || !_settings_game.economy.allow_shares || _current_player == (PlayerID)p1) return CMD_ERROR; p = GetPlayer((PlayerID)p1); @@ -1833,7 +1833,7 @@ CommandCost CmdSellShareInCompany(TileIn /* Check if selling shares is allowed (protection against modified clients) */ /* Cannot sell own shares */ - if (!IsValidPlayer((PlayerID)p1) || !_settings_game.economy.allow_shares || _current_player == (PlayerID)p1) return CMD_ERROR; + if (!IsValidPlayerID((PlayerID)p1) || !_settings_game.economy.allow_shares || _current_player == (PlayerID)p1) return CMD_ERROR; p = GetPlayer((PlayerID)p1); @@ -1871,7 +1871,7 @@ CommandCost CmdBuyCompany(TileIndex tile PlayerID pid = (PlayerID)p1; /* Disable takeovers in multiplayer games */ - if (!IsValidPlayer(pid) || _networking) return CMD_ERROR; + if (!IsValidPlayerID(pid) || _networking) return CMD_ERROR; /* Do not allow players to take over themselves */ if (pid == _current_player) return CMD_ERROR;