From db18064a995e072c7d751259f148017fb012c148 Mon Sep 17 00:00:00 2001 From: Will/KJW <100206101+SpicyBagpipes@users.noreply.github.com> Date: Thu, 26 Oct 2023 19:03:55 +0100 Subject: [PATCH] Update XEH_postInit.sqf --- addons/hitreactions/XEH_postInit.sqf | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/addons/hitreactions/XEH_postInit.sqf b/addons/hitreactions/XEH_postInit.sqf index abf792b23c3..78c2a357367 100644 --- a/addons/hitreactions/XEH_postInit.sqf +++ b/addons/hitreactions/XEH_postInit.sqf @@ -19,9 +19,7 @@ if (isNil QGVAR(undroppableGuns)) then {GVAR(undroppableGuns) = DEFAULT_UNDROPPA params ["", "", "", "", "", "", "_projectile"]; if (GVAR(weaponDropChanceGunHit) + GVAR(weaponDropChanceArmHit) == 0) exitWith {}; private _roll = random 1; - private _willDropGun = _roll < GVAR(weaponDropChanceGunHit); - private _willDropArm = _roll < GVAR(weaponDropChanceArmHit); - if (!(_willDropGun || _willDropArm)) exitWith {}; + if (!(_roll < GVAR(weaponDropChanceGunHit) || _roll < GVAR(weaponDropChanceArmHit))) exitWith {}; _projectile addEventHandler ["HitPart", { params ["_projectile", "_hitEntity", "_projectileOwner", "_pos", "_velocity", "_normal", "_components", "_radius" ,"_surfaceType"]; [_surfaceType, _components, _pos] call FUNC(checkWeaponDrop); @@ -34,9 +32,7 @@ if (!hasInterface) exitWith {}; params ["", "", "", "", "", "", "_projectile"]; if (GVAR(weaponDropChanceGunHit) + GVAR(weaponDropChanceArmHit) == 0) exitWith {}; private _roll = random 1; - private _willDropGun = _roll < GVAR(weaponDropChanceGunHit); - private _willDropArm = _roll < GVAR(weaponDropChanceArmHit); - if (!(_willDropGun && _willDropArm)) exitWith {}; + if (!(_roll < GVAR(weaponDropChanceGunHit) || _roll < GVAR(weaponDropChanceArmHit))) exitWith {}; _projectile addEventHandler ["HitPart", { params ["_projectile", "_hitEntity", "_projectileOwner", "_pos", "_velocity", "_normal", "_components", "_radius" ,"_surfaceType"]; [_surfaceType, _components, _pos] call FUNC(checkWeaponDrop);