Fix underflow in consistancy checking code

This commit is contained in:
Louis-Antoine 2020-10-26 23:15:22 +01:00
parent 50d2c95470
commit 9f5686ef48

View file

@ -4067,7 +4067,7 @@ static void HandlePacketFromPlayer(SINT8 node)
&netbuffer->u.client2pak.cmd2, 1);
// Check player consistancy during the level
if (realstart <= gametic && realstart > gametic - BACKUPTICS+1 && gamestate == GS_LEVEL
if (realstart <= gametic && realstart + BACKUPTICS - 1 > gametic && gamestate == GS_LEVEL
&& consistancy[realstart%BACKUPTICS] != SHORT(netbuffer->u.clientpak.consistancy)
&& !resendingsavegame[node])
{