From 4ef116643d9a1f09910db6077b99118b315a5b05 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Mon, 15 Jan 2024 18:10:30 -0600 Subject: [PATCH 1/2] Small optimization to optimize config lookup quick testing shows a whole 600ns increase in Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/frag/functions/fnc_dev_fragCalcDump.sqf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/frag/functions/fnc_dev_fragCalcDump.sqf b/addons/frag/functions/fnc_dev_fragCalcDump.sqf index ef92cd9c77..988df479e6 100644 --- a/addons/frag/functions/fnc_dev_fragCalcDump.sqf +++ b/addons/frag/functions/fnc_dev_fragCalcDump.sqf @@ -40,8 +40,9 @@ diag_log text "//****************** fragCalcDump Beg ******************//"; private _fragInfo = [_ammo] call FUNC(getFragInfo); _fragInfo params ["_fragRange", "_fragMaxVelocity", "", "_modifiedFragCount"]; private _fragCount = 4 * pi* _modifiedFragCount; - private _indirectHitRange = getNumber (configFile >> "cfgAmmo" >> _ammo >> "indirectHitRange"); - private _indirectHit = getNumber (configFile >> "cfgAmmo" >> _ammo >> "indirectHit"); + private _ammoConfig = configFile >> "CfgAmmo" >> _ammo; + private _indirectHitRange = getNumber (_ammoConfig >> "indirectHitRange"); + private _indirectHit = getNumber (_ammoConfig >> "indirectHit"); private _fragPowerSpeedRange = [0.5, 1] vectorMultiply _fragMaxVelocity; diag_log text format ["Ammo type: %1 | Should frag: %2", _ammo, _shouldFrag]; From 902af64d7efb65b494c2bb68c58d3bb83d7f88fd Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Mon, 15 Jan 2024 18:16:06 -0600 Subject: [PATCH 2/2] avoid mismatch sides when debugging frags with unconcious or captive shooters Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/frag/functions/fnc_dev_fired.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/frag/functions/fnc_dev_fired.sqf b/addons/frag/functions/fnc_dev_fired.sqf index aa5e59a33a..cc67b89f58 100644 --- a/addons/frag/functions/fnc_dev_fired.sqf +++ b/addons/frag/functions/fnc_dev_fired.sqf @@ -16,4 +16,4 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); -[_projectile, true, ((side _unit) getFriend (side ACE_player)) >= 0.6] call FUNC(dev_addRound); +[_projectile, true, [side group _unit, side group ACE_player] call BIS_fnc_sideIsFriendly] call FUNC(dev_addRound);