From 02dd35f63f8c3f0b23b49bce1f87689642c7d05c Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Mon, 8 Jan 2024 21:55:02 -0600 Subject: [PATCH] Reformatted for readability and optimized first if statement --- addons/frag/functions/fnc_initRound.sqf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/frag/functions/fnc_initRound.sqf b/addons/frag/functions/fnc_initRound.sqf index fc13bba93f..9a1677d2b6 100644 --- a/addons/frag/functions/fnc_initRound.sqf +++ b/addons/frag/functions/fnc_initRound.sqf @@ -14,23 +14,23 @@ * * Public: No */ -params ["_projectile"]; +params [ + ["_projectile", objNull, [objNull]] +]; private _ammo = typeOf _projectile; -if (isNil "_ammo" || - {_ammo isEqualTo "" || - {isNil "_projectile" || - {isNull _projectile}}}) exitWith { +if (_ammo isEqualTo "" || {isNull _projectile}) exitWith { TRACE_2("bad ammo or projectile",_ammo,_projectile); }; - private _shouldFrag = _ammo call FUNC(shouldFrag); _shouldFrag params ["_doFrag"]; if (_doFrag) then { // wait for frag damage to kill units before spawning fragments - _projectile addEventHandler ["Explode", { + _projectile addEventHandler [ + "Explode", + { if (isServer) then { [FUNC(doFrag), [_this]] call CBA_fnc_execNextFrame; } else {