Fix 64-bit build-using admins not being able to kick players besides themselves, by not checking sendingsavegame[] code at all if not the server

it turns out playernode[pn] is typically 255 in the above situation, so sendingsavegame[playernode[pn]] goes out of bounds ...but goodness knows why 32-bit builds didn't suffer the same bug, seems to have been pure luck
This commit is contained in:
Monster Iestyn 2018-12-05 17:39:02 +00:00
parent ae14fd2f85
commit aee8dcdff8

View file

@ -2650,13 +2650,16 @@ static void Command_Kick(void)
if (pn == -1 || pn == 0)
return;
// Special case if we are trying to kick a player who is downloading the game state:
// trigger a timeout instead of kicking them, because a kick would only
// take effect after they have finished downloading
if (sendingsavegame[playernode[pn]])
if (server)
{
Net_ConnectionTimeout(playernode[pn]);
return;
// Special case if we are trying to kick a player who is downloading the game state:
// trigger a timeout instead of kicking them, because a kick would only
// take effect after they have finished downloading
if (sendingsavegame[playernode[pn]])
{
Net_ConnectionTimeout(playernode[pn]);
return;
}
}
WRITESINT8(p, pn);