From 4f251767d788cafae063b3cea6b62811020bbf63 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Thu, 18 Jul 2024 22:33:19 -0500 Subject: [PATCH] updated some defne names and usages --- addons/frag/functions/fnc_doSpall.sqf | 2 +- addons/frag/functions/fnc_fired.sqf | 4 ++-- addons/frag/functions/fnc_frago.sqf | 3 +-- addons/frag/script_component.hpp | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/addons/frag/functions/fnc_doSpall.sqf b/addons/frag/functions/fnc_doSpall.sqf index 7a0a57d765..1c9e039094 100644 --- a/addons/frag/functions/fnc_doSpall.sqf +++ b/addons/frag/functions/fnc_doSpall.sqf @@ -71,7 +71,7 @@ for "_i" from 0 to 100 do { if (_spallPosAGL isEqualTo []) exitWith { TRACE_1("can't find other side",_oldPosASL); }; -(_shotParents#1) setVariable [QGVAR(nextSpallEvent), CBA_missionTime + ACE_FRAG_SPALL_EVENT_HOLDOFF]; +(_shotParents#1) setVariable [QGVAR(nextSpallEvent), CBA_missionTime + ACE_FRAG_SPALL_UNIT_HOLDOFF]; private _spallVelocitySpherical = _oldVelocity call CBA_fnc_vect2polar; if (_explosive > 0) then { diff --git a/addons/frag/functions/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf index 6a978c56f1..8f32474f4c 100644 --- a/addons/frag/functions/fnc_fired.sqf +++ b/addons/frag/functions/fnc_fired.sqf @@ -40,7 +40,7 @@ if (GVAR(spallEnabled) && {_ammo call FUNC(shouldSpall)}) then { * multiple hits / slowdowns getting shunted to the first hit */ [ - // only let a unit make a frag event once per ACE_FRAG_SPALL_EVENT_HOLDOFF + // only let a unit make a frag event once per ACE_FRAG_SPALL_UNIT_HOLDOFF { private _shotParents = _this#5; if (CBA_missionTime < _shotParents#1 getVariable [QGVAR(nextSpallEvent), -1]) exitWith {}; @@ -69,7 +69,7 @@ if (GVAR(reflectionsEnabled) || GVAR(enabled) && _ammo call FUNC(shouldFrag)) th // only let a unit make a frag event once per second private _instigator = _shotParents#1; if (CBA_missionTime < (_instigator getVariable [QGVAR(nextFragEvent), -1])) exitWith {}; - _instigator setVariable [QGVAR(nextFragEvent), CBA_missionTime + ACE_FRAG_FRAG_EVENT_HOLDOFF]; + _instigator setVariable [QGVAR(nextFragEvent), CBA_missionTime + ACE_FRAG_FRAG_UNIT_HOLDOFF]; // Wait a frame to make sure it doesn't target the dead [ diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index a90f38fc48..a238dc3718 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -19,7 +19,6 @@ */ #define FRAG_VEC_VAR 0.004 -#define MAX_FRAG_COUNT 50 BEGIN_COUNTER(frago); @@ -27,7 +26,7 @@ params ["_fragPosASL", "_lastVel", "_shellType", "_shotParents"]; TRACE_4("frago",_fragPosASL,_lastVel,_shellType,_shotParents); // Limit max frag count if there was a recent frag -private _maxFrags = round (MAX_FRAG_COUNT * linearConversion [ACE_FRAG_COUNT_MIN_TIME, ACE_FRAG_COUNT_MAX_TIME, (CBA_missionTime - GVAR(lastFragTime)), 0.1, 1, true]); +private _maxFrags = round linearConversion [ACE_FRAG_COUNT_MIN_TIME, ACE_FRAG_COUNT_MAX_TIME, (CBA_missionTime - GVAR(lastFragTime)), ACE_FRAG_COUNT_MIN, ACE_FRAG_COUNT_MAX, true]; TRACE_2("",_maxFrags,CBA_missionTime - GVAR(lastFragTime)); GVAR(lastFragTime) = CBA_missionTime; diff --git a/addons/frag/script_component.hpp b/addons/frag/script_component.hpp index 9b8f2babe1..ff960419e3 100644 --- a/addons/frag/script_component.hpp +++ b/addons/frag/script_component.hpp @@ -19,8 +19,8 @@ #include "\z\ace\addons\main\script_macros.hpp" // Mimimum hold-off time between frag events per unit -#define ACE_FRAG_FRAG_EVENT_HOLDOFF 0.5 -#define ACE_FRAG_SPALL_EVENT_HOLDOFF 0.5 +#define ACE_FRAG_FRAG_UNIT_HOLDOFF 0.5 +#define ACE_FRAG_SPALL_UNIT_HOLDOFF 0.5 // Scaling for the min/max # of fragments since last frag event #define ACE_FRAG_COUNT_MIN_TIME 0.1 #define ACE_FRAG_COUNT_MIN 5