diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf index 1d2b3af267..b8b6e39f10 100644 --- a/addons/frag/XEH_postInit.sqf +++ b/addons/frag/XEH_postInit.sqf @@ -9,7 +9,7 @@ }; #ifdef DEBUG_MODE_DRAW - if (hasInterface && GVAR(debugOptions)) then { + if (hasInterface) then { private _h = [LINKFUNC(dev_drawTrace), 0] call CBA_fnc_addPerFrameHandler; missionNamespace setVariable [QGVAR(dev_drawPFEH), _h]; ["unit", LINKFUNC(dev_switchUnitHandle), true] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/frag/XEH_preInit.sqf b/addons/frag/XEH_preInit.sqf index c13f60edb3..371d8c7a6e 100644 --- a/addons/frag/XEH_preInit.sqf +++ b/addons/frag/XEH_preInit.sqf @@ -8,7 +8,8 @@ PREP_RECOMPILE_END; GVAR(spallMaterialCache) = createHashMap; -GVAR(spallRoundCache) = createHashMap; +GVAR(spallInfoCache) = createHashMap; +GVAR(shouldSpallCache) = createHashMap; GVAR(lastSpallTime) = -2; GVAR(shouldFragCache) = createHashMap; diff --git a/addons/frag/functions/fnc_doFrag.sqf b/addons/frag/functions/fnc_doFrag.sqf index e9d10c6b2f..e66349a8df 100644 --- a/addons/frag/functions/fnc_doFrag.sqf +++ b/addons/frag/functions/fnc_doFrag.sqf @@ -19,7 +19,7 @@ * * Public: No */ -TRACE_1("",_this); +TRACE_1("begin doFrag",_this); params [ ["_proj", objNull, [objNull]], ["_posASL", [0, 0, 0], [[]], [3]], @@ -41,7 +41,7 @@ if (_ammo isEqualTo "" || {_posASL isEqualTo [0, 0, 0] || _timeSince < ACE_FRAG_ TRACE_3("timeExit",_timeSince,CBA_missionTime,GVAR(lastFragTime)); }; private _maxFrags = round linearConversion [0.1, 1.5, _timeSince, ACE_FRAG_COUNT_MIN, ACE_FRAG_COUNT_MAX, true]; -TRACE_3("",_timeSince,CBA_missionTime,_maxFrags); +TRACE_3("willFrag",_timeSince,CBA_missionTime,_maxFrags); private _ammoArr = [_ammo] call FUNC(getFragInfo); diff --git a/addons/frag/functions/fnc_initBlackList.sqf b/addons/frag/functions/fnc_initBlackList.sqf index a79ed223ae..37e2b1787b 100644 --- a/addons/frag/functions/fnc_initBlackList.sqf +++ b/addons/frag/functions/fnc_initBlackList.sqf @@ -15,14 +15,14 @@ * Public: No */ -TRACE_1("Beginning blacklist init", GVAR(BlackList)); +TRACE_1("Beginning blacklist init", GVAR(blackList)); if (!ADDON) then { [FUNC(initBlackList), [], 1] call CBA_fnc_waitAndExecute; }; // could improve text parsing of CBA setting string -private _convArray = parseSimpleArray GVAR(BlackList); +private _convArray = parseSimpleArray GVAR(blackList); if (count _convArray == 0 ) exitWith { TRACE_1("Empty blacklist", _convArray); diff --git a/addons/frag/functions/fnc_initRound.sqf b/addons/frag/functions/fnc_initRound.sqf index a542e59ee0..8b25afb322 100644 --- a/addons/frag/functions/fnc_initRound.sqf +++ b/addons/frag/functions/fnc_initRound.sqf @@ -14,7 +14,7 @@ * * Public: No */ - TRACE_1("",_this); + TRACE_1("ACE_Frag rndInit",_this); params [ ["_projectile", objNull, [objNull]] ]; @@ -59,6 +59,10 @@ if (GVAR(spallEnabled) && {_shouldSpall}) then private _shotPrnt = getShotParents _proj; private _ammo = typeOf _proj; private _vUp = vectorUp _proj; + /* + * Wait a round to see what happens to the round, may result in + * multiple hits / slowdowns getting shunted to the first hit + */ [ FUNC(doSpall), [_proj, _hitObj, _posASL, _vel, _sNorm, _surfType, _ammo, _shotPrnt, _vUp] @@ -66,4 +70,9 @@ if (GVAR(spallEnabled) && {_shouldSpall}) then } ]; }; -TRACE_2("exit",_shouldFrag,_shouldSpall); \ No newline at end of file +#ifdef DEBUG_MODE_DRAW +if (GVAR(debugOptions) && (_shouldFrag || _shouldSpall)) then { + [_projectile, "red", true] call FUNC(dev_trackObj); +}; +#endif +TRACE_2("initExit",_shouldFrag,_shouldSpall); \ No newline at end of file diff --git a/addons/frag/functions/fnc_shouldSpall.sqf b/addons/frag/functions/fnc_shouldSpall.sqf index 393e2984c8..1d77a07256 100644 --- a/addons/frag/functions/fnc_shouldSpall.sqf +++ b/addons/frag/functions/fnc_shouldSpall.sqf @@ -18,16 +18,16 @@ params ["_ammo"]; -private _shouldSpall = GVAR(spallRoundCache) get _ammo; +private _shouldSpall = GVAR(shouldSpallCache) get _ammo; if (!isNil "_shouldSpall") exitWith {_shouldSpall}; private _caliber = getNumber (configFile >> "CfgAmmo" >> _ammo >> "caliber"); private _explosive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosive"); -private _idH = getNumber (configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange"); +private _indirectHit = getNumber (configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange"); -_shouldSpall = _caliber >= 2.5 || (_explosive > 0 && _idh >= 1); +_shouldSpall = _caliber * GVAR(spallIntensity) >= 2.5 || (_explosive >= 0.5 && _explosive * _indirectHit * GVAR(spallIntensity) >= 4); -GVAR(spallRoundCache) set [_ammo, _shouldSpall]; +GVAR(shouldSpallCache) set [_ammo, _shouldSpall]; _shouldSpall \ No newline at end of file