From ff38894d1a78a889013af5ed38e3a6d3919c7fdd Mon Sep 17 00:00:00 2001 From: x3Karma Date: Fri, 4 Mar 2022 23:11:43 +0800 Subject: prevent crash if offhand slot is not found when using Tactikill (#255) --- .../mod/scripts/vscripts/weapons/_weapon_utility.nut | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Northstar.CustomServers/mod/scripts/vscripts/weapons') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/weapons/_weapon_utility.nut b/Northstar.CustomServers/mod/scripts/vscripts/weapons/_weapon_utility.nut index b3e5f5a3..40d42fd1 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/weapons/_weapon_utility.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/weapons/_weapon_utility.nut @@ -2774,6 +2774,8 @@ void function PAS_CooldownReduction_OnKill( entity victim, entity attacker, var if ( GetCurrentPlaylistVarInt( "featured_mode_tactikill", 0 ) > 0 ) { entity weapon = attacker.GetOffhandWeapon( OFFHAND_LEFT ) + if ( !IsValid(weapon) ) + return switch ( GetWeaponInfoFileKeyField_Global( weapon.GetWeaponClassName(), "cooldown_type" ) ) { @@ -2807,6 +2809,8 @@ void function PAS_CooldownReduction_OnKill( entity victim, entity attacker, var return entity weapon = attacker.GetOffhandWeapon( OFFHAND_LEFT ) + if ( !IsValid(weapon) ) + return switch ( GetWeaponInfoFileKeyField_Global( weapon.GetWeaponClassName(), "cooldown_type" ) ) { -- cgit v1.2.3