From 4583a0dc9ca27dc52195ff490616a4dac8eca5a0 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Sat, 2 Mar 2024 23:55:32 -0600 Subject: [PATCH] reformatted comments and some v2.18 remakrs comments --- addons/frag/functions/fnc_doFrag.sqf | 8 ++++---- addons/frag/functions/fnc_doFragTargeted.sqf | 2 +- addons/frag/functions/fnc_initRound.sqf | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/addons/frag/functions/fnc_doFrag.sqf b/addons/frag/functions/fnc_doFrag.sqf index 252fedea4e..0b11b809cd 100644 --- a/addons/frag/functions/fnc_doFrag.sqf +++ b/addons/frag/functions/fnc_doFrag.sqf @@ -22,9 +22,9 @@ TRACE_1("begin doFrag",_this); params ["_posASL", "_velocity", "_ammo", "_shotParents"]; // Don't let a single object cause all fragmentation events -_shotParents params ["_shotParentVehicles"]; -if (_shotParentVehicles getVariable [QGVAR(obj_nextFragTime), -1] > CBA_missionTime) exitWith { - TRACE_1("vehicleTimeExit",_shotParentVehicles); +_shotParents params ["_shotParentVehicle"]; +if (_shotParentVehicle getVariable [QGVAR(obj_nextFragTime), -1] > CBA_missionTime) exitWith { + TRACE_1("vehicleTimeExit",_shotParentVehicle); }; // Check normal round timeout and adjust _max frags @@ -33,7 +33,7 @@ if (_timeSinceLastFrag < ACE_FRAG_HOLDOFF || {_posASL isEqualTo [0, 0, 0]} || {_ TRACE_3("timeExit",_timeSinceLastFrag,CBA_missionTime,GVAR(lastFragTime)); }; TRACE_3("willFrag",_timeSinceLastFrag,CBA_missionTime,_maxFragCount); -_shotParentVehicles setVariable [QGVAR(obj_nextFragTime), CBA_missionTime + ACE_FRAG_HOLDOFF_VEHICLE]; +_shotParentVehicle setVariable [QGVAR(obj_nextFragTime), CBA_missionTime + ACE_FRAG_HOLDOFF_VEHICLE]; private _maxFragCount = round linearConversion [ACE_FRAG_COUNT_MIN_TIME, ACE_FRAG_COUNT_MAX_TIME, _timeSinceLastFrag, ACE_FRAG_COUNT_MIN, ACE_FRAG_COUNT_MAX, true]; [_ammo] call FUNC(getFragInfo) params ["_fragRange", "_fragVel", "_fragTypes", "_modFragCount"]; diff --git a/addons/frag/functions/fnc_doFragTargeted.sqf b/addons/frag/functions/fnc_doFragTargeted.sqf index 6630f460ab..3c2614cd27 100644 --- a/addons/frag/functions/fnc_doFragTargeted.sqf +++ b/addons/frag/functions/fnc_doFragTargeted.sqf @@ -171,7 +171,7 @@ private _totalFragCount = 0; } forEach _targets; #ifdef DEBUG_MODE_FULL -systemChat ("targeted frag count: " + str _totalFragCount); +systemChat ("targeted frag count: " + str _totalFragCount); TRACE_1("targeted frag count",_totalFragCount); #endif _totalFragCount diff --git a/addons/frag/functions/fnc_initRound.sqf b/addons/frag/functions/fnc_initRound.sqf index 0cab59f4f6..5d8bb2a172 100644 --- a/addons/frag/functions/fnc_initRound.sqf +++ b/addons/frag/functions/fnc_initRound.sqf @@ -49,6 +49,8 @@ if (GVAR(spallEnabled) && {_ammo call FUNC(shouldSpall)}) then { "HitPart", { params ["_projectile", "_hitObject", "", "_posASL", "_velocity", "_surfNorm", "", "", "_surfType"]; + // 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 private _shotParent = getShotParents _projectile; private _ammo = typeOf _projectile; private _vectorUp = vectorUp _projectile;