From 8d071f9eb59a2825e787509992bdd2be9f7581be Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Sun, 19 May 2024 13:40:26 -0500 Subject: [PATCH] added debug information and folded if statements --- addons/frag/functions/fnc_initRound.sqf | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/frag/functions/fnc_initRound.sqf b/addons/frag/functions/fnc_initRound.sqf index 46d4281c6a..ab041f763e 100644 --- a/addons/frag/functions/fnc_initRound.sqf +++ b/addons/frag/functions/fnc_initRound.sqf @@ -21,11 +21,12 @@ if (!isServer) exitWith {}; params ["_projectile"]; private _ammo = typeOf _projectile; -if (_ammo isEqualTo "" || {isNull _projectile}) exitWith { - TRACE_2("bad ammo or projectile",_ammo,_projectile); +if (_ammo isEqualTo "" || {isNull _projectile} || + {_projectile getVariable [QGVAR(blacklisted), false]}) exitWith { + TRACE_2("bad ammo or projectile, or blackList",_ammo,_projectile); }; -if (_projectile getVariable [QGVAR(blacklisted), false]) exitWith {}; +if () exitWith {}; if (GVAR(enabled) && {_ammo call FUNC(shouldFrag)}) then { _projectile addEventHandler [ @@ -33,7 +34,9 @@ if (GVAR(enabled) && {_ammo call FUNC(shouldFrag)}) then { { params ["_projectile", "_posASL", "_velocity"]; - if (_projectile getVariable [QGVAR(blacklisted), false]) exitWith {}; + if (_projectile getVariable [QGVAR(blacklisted), false]) exitWith { + TRACE_2("projectile blackisted",typeOf _projectile,_projectile); + }; private _shotParents = _projectile getVariable [QGVAR(shotParent), getShotParents _projectile]; private _ammo = typeOf _projectile; @@ -55,7 +58,9 @@ if (GVAR(spallEnabled) && {_ammo call FUNC(shouldSpall)}) then { { params ["_projectile", "_hitObject", "", "_posASL", "_velocity", "_surfNorm", "", "", "_surfType"]; - if (_projectile getVariable [QGVAR(blacklisted), false]) exitWith {}; + if (_projectile getVariable [QGVAR(blacklisted), false]) exitWith { + TRACE_2("projectile blackisted",typeOf _projectile,_projectile); + }; // starting v2.18 it may be faster to use the instigator parameter, the same as the second entry shotParents, to recreate _shotParent // The "explode" EH does not get the same parameter