From 97b129e2fe6abbb6ec13e692e0b19a378f51a358 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Tue, 11 Sep 2018 07:58:33 +1000 Subject: [PATCH] vending machine bug fix --- gamemodes/irresistible/anticheat/vending_machines.pwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gamemodes/irresistible/anticheat/vending_machines.pwn b/gamemodes/irresistible/anticheat/vending_machines.pwn index f43718e..4b22f86 100644 --- a/gamemodes/irresistible/anticheat/vending_machines.pwn +++ b/gamemodes/irresistible/anticheat/vending_machines.pwn @@ -122,7 +122,7 @@ hook OnPlayerConnect( playerid ) hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) { - if ( ( ( ( newkeys & KEY_SECONDARY_ATTACK ) == KEY_SECONDARY_ATTACK ) && ( ( oldkeys & KEY_SECONDARY_ATTACK ) != KEY_SECONDARY_ATTACK ) ) ) // pressed ENTER + if ( 0 <= playerid < MAX_PLAYERS && ( ( ( newkeys & KEY_SECONDARY_ATTACK ) == KEY_SECONDARY_ATTACK ) && ( ( oldkeys & KEY_SECONDARY_ATTACK ) != KEY_SECONDARY_ATTACK ) ) ) // pressed ENTER { if ( GetPlayerState( playerid ) == PLAYER_STATE_ONFOOT && p_VendingUseTimer[ playerid ] == -1 && GetPlayerAnimationIndex( playerid ) != 1660 ) { @@ -221,7 +221,7 @@ public VendingMachineUsed( playerid, Float: fHealthGiven ) /* ** Functions ** */ stock ResetPlayerVendingMachineData( playerid ) { - if ( p_VendingUseTimer[ playerid ] != -1 ) + if ( 0 <= playerid < MAX_PLAYERS && p_VendingUseTimer[ playerid ] != -1 ) { KillTimer( p_VendingUseTimer[ playerid ] ); p_VendingUseTimer[ playerid ] = -1;