From 184896945de6669e5b17d2046c8456ff8982bdb4 Mon Sep 17 00:00:00 2001 From: Bluefield Date: Sun, 13 Oct 2024 15:27:17 +0200 Subject: [PATCH 01/29] feat: overpressure settings note: doesnt work yet --- addons/overpressure/ACE_Settings.hpp | 5 +++++ addons/overpressure/cfgEden.hpp | 20 +++++++++++++++++++ addons/overpressure/config.cpp | 3 ++- .../overpressure/functions/fnc_firedEHOP.sqf | 9 ++++++++- 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 addons/overpressure/ACE_Settings.hpp create mode 100644 addons/overpressure/cfgEden.hpp diff --git a/addons/overpressure/ACE_Settings.hpp b/addons/overpressure/ACE_Settings.hpp new file mode 100644 index 00000000000..d8b109ea49b --- /dev/null +++ b/addons/overpressure/ACE_Settings.hpp @@ -0,0 +1,5 @@ +class ACE_Settings { + class GVAR(overPressureDistanceSetting) { + movedToSQF = 1; + }; +} \ No newline at end of file diff --git a/addons/overpressure/cfgEden.hpp b/addons/overpressure/cfgEden.hpp new file mode 100644 index 00000000000..145184b0649 --- /dev/null +++ b/addons/overpressure/cfgEden.hpp @@ -0,0 +1,20 @@ +class Cfg3DEN { + class Object { + class AttributeCategories { + class ace_attributes { + class Attributes { + class GVAR(overPressureDistanceSetting) { + property = QUOTE(overpressureDistanceCoefficient); + control = QGVAR(slider); + displayName = CSTRING(Overpressure_distanceCoefficient_displayName); + tooltip = CSTRING(Overpressure_distanceCoefficient_toolTip); + expression = QUOTE(if (_value >= 0.1) then {_this setVariable [ARR_3(QQEGVAR(overpressure,distance),_value,true)]}); // ace_overpressure_distance + typeName = "NUMBER"; + condition = "objectVehicle"; + defaultValue = 0; + }; + }; + }; + }; + }; +}; diff --git a/addons/overpressure/config.cpp b/addons/overpressure/config.cpp index 7274cd50593..238acb8e8c6 100644 --- a/addons/overpressure/config.cpp +++ b/addons/overpressure/config.cpp @@ -8,7 +8,7 @@ class CfgPatches { requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author = ECSTRING(common,ACETeam); - authors[] = {"commy2","KoffeinFlummi","esteldunedain"}; + authors[] = {"commy2","KoffeinFlummi","esteldunedain", "bluefield"}; url = ECSTRING(main,URL); VERSION_CONFIG; }; @@ -17,3 +17,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgWeapons.hpp" #include "ACE_Arsenal_Stats.hpp" +#include "CfgEden.hpp" diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index eb51a055076..94a0cc6a212 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -18,11 +18,18 @@ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; TRACE_8("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_gunner); + + // Retrieve overpressure values private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues); _opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"]; -_dangerZoneRange = _dangerZoneRange * GVAR(overpressureDistanceCoefficient); + +// Check if the unit attribute slider is set, if not, use the general config one... bit messy. +private _unitCoef = _unit getVariable [QEGVAR(overpressure,distance), GVAR(overpressureDistanceCoefficient)]; + +// We check the unitCoef this time. +_dangerZoneRange = _dangerZoneRange * _unitCoef; TRACE_3("cache",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage); From 10c1601d203eb8466e01719603c53eedb1351af6 Mon Sep 17 00:00:00 2001 From: Bluefield Date: Sun, 13 Oct 2024 16:43:25 +0200 Subject: [PATCH 02/29] fix: stuff --- addons/overpressure/ACE_Settings.hpp | 5 -- addons/overpressure/cfgEden.hpp | 29 +++++++ .../overpressure/functions/fnc_firedEHOP.sqf | 78 +++++++++---------- 3 files changed, 67 insertions(+), 45 deletions(-) delete mode 100644 addons/overpressure/ACE_Settings.hpp diff --git a/addons/overpressure/ACE_Settings.hpp b/addons/overpressure/ACE_Settings.hpp deleted file mode 100644 index d8b109ea49b..00000000000 --- a/addons/overpressure/ACE_Settings.hpp +++ /dev/null @@ -1,5 +0,0 @@ -class ACE_Settings { - class GVAR(overPressureDistanceSetting) { - movedToSQF = 1; - }; -} \ No newline at end of file diff --git a/addons/overpressure/cfgEden.hpp b/addons/overpressure/cfgEden.hpp index 145184b0649..94098852d9a 100644 --- a/addons/overpressure/cfgEden.hpp +++ b/addons/overpressure/cfgEden.hpp @@ -1,4 +1,33 @@ class Cfg3DEN { + class Attributes { + class Slider; + class GVAR(slider): Slider { + attributeLoad = "params [""_ctrlGroup""];\ + private _slider = _ctrlGroup controlsGroupCtrl 100;\ + private _edit = _ctrlGroup controlsGroupCtrl 101;\ + _slider sliderSetPosition _value;\ + _edit ctrlSetText ([_value, 1, 1] call CBA_fnc_formatNumber);"; + attributeSave = "params [""_ctrlGroup""];\ + sliderPosition (_ctrlGroup controlsGroupCtrl 100); "; + onLoad = "params [""_ctrlGroup""];\ + private _slider = _ctrlGroup controlsGroupCtrl 100;\ + private _edit = _ctrlGroup controlsGroupCtrl 101;\ + _slider sliderSetRange [0, 10];\ + _slider ctrlAddEventHandler [""SliderPosChanged"", {\ + params [""_slider""];\ + private _edit = (ctrlParentControlsGroup _slider) controlsGroupCtrl 101;\ + private _value = sliderPosition _slider;\ + _edit ctrlSetText ([_value, 1, 1] call CBA_fnc_formatNumber);\ + }];\ + _edit ctrlAddEventHandler [""KillFocus"", {\ + params [""_edit""];\ + private _slider = (ctrlParentControlsGroup _edit) controlsGroupCtrl 100;\ + private _value = ((parseNumber ctrlText _edit) min 10) max 0;\ + _slider sliderSetPosition _value;\ + _edit ctrlSetText ([_value, 1, 1] call CBA_fnc_formatNumber);\ + }];"; + }; + }; class Object { class AttributeCategories { class ace_attributes { diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index 94a0cc6a212..3ae4bd55cfb 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -1,32 +1,30 @@ #include "..\script_component.hpp" /* * Author: joko // Jonas - * Handle fire of Vehicle Weapons. Called from the unified fired EH only for the local player vehicle. - * - * Arguments: - * None. Parameters inherited from EFUNC(common,firedEH) - * - * Return Value: - * None - * - * Example: - * [tank, "cannon_125mm", "cannon_125mm", "player", "Sh_125mm_APFSDS_T_Green", "24Rnd_125mm_APFSDS_T_Green", projectile] call ace_overpressure_fnc_firedEHOP - * - * Public: No + * Handle fire of vehicle weapons. Called from the unified fired EH only for the local player vehicle. + * + * Arguments: + * None. Parameters inherited from EFUNC(common, firedEH) + * + * Return Value: + * None + * + * Example: + * [tank, "cannon_125mm", "cannon_125mm", "player", "Sh_125mm_APFSDS_T_Green", "24Rnd_125mm_APFSDS_T_Green", projectile] call ace_overpressure_fnc_firedEHOP + * + * Public: No */ -//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; -TRACE_8("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_gunner); - - +// IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; +TRACE_8("firedEH:", _unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _gunner); // Retrieve overpressure values private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues); _opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"]; -// Check if the unit attribute slider is set, if not, use the general config one... bit messy. private _unitCoef = _unit getVariable [QEGVAR(overpressure,distance), GVAR(overpressureDistanceCoefficient)]; +systemChat format ["coef = %1", _unitCoef]; // We check the unitCoef this time. _dangerZoneRange = _dangerZoneRange * _unitCoef; @@ -39,7 +37,7 @@ if (_dangerZoneDamage <= 0) exitWith {}; private _position = getPosASL _projectile; private _direction = vectorDir _projectile; -// Damage to others +// damage to others private _affected = (ASLToAGL _position) nearEntities ["CAManBase", _dangerZoneRange]; // Let each client handle their own affected units @@ -47,27 +45,27 @@ private _affected = (ASLToAGL _position) nearEntities ["CAManBase", _dangerZoneR // Draw debug lines #ifdef DEBUG_MODE_FULL - [ _position, - _position vectorAdd (_direction vectorMultiply _dangerZoneRange), - [1,0,0,1] - ] call EFUNC(common,addLineToDebugDraw); +[ _position, + _position vectorAdd (_direction vectorMultiply _dangerZoneRange), + [1, 0, 0, 1] +] call EFUNC(common, addLineToDebugDraw); - private _ref = _direction call EFUNC(common,createOrthonormalReference); - [ _position, - _position vectorAdd (_direction vectorMultiply _dangerZoneRange) vectorAdd ((_ref select 1) vectorMultiply _dangerZoneRange * tan _dangerZoneAngle), - [1,1,0,1] - ] call EFUNC(common,addLineToDebugDraw); - [ _position, - _position vectorAdd (_direction vectorMultiply _dangerZoneRange) vectorDiff ((_ref select 1) vectorMultiply _dangerZoneRange * tan _dangerZoneAngle), - [1,1,0,1] - ] call EFUNC(common,addLineToDebugDraw); - [ _position, - _position vectorAdd (_direction vectorMultiply _dangerZoneRange) vectorAdd ((_ref select 2) vectorMultiply _dangerZoneRange * tan _dangerZoneAngle), - [1,1,0,1] - ] call EFUNC(common,addLineToDebugDraw); - [ _position, - _position vectorAdd (_direction vectorMultiply _dangerZoneRange) vectorDiff ((_ref select 2) vectorMultiply _dangerZoneRange * tan _dangerZoneAngle), - [1,1,0,1] - ] call EFUNC(common,addLineToDebugDraw); +private _ref = _direction call EFUNC(common, createOrthonormalReference); +[ _position, + _position vectorAdd (_direction vectorMultiply _dangerZoneRange) vectorAdd ((_ref select 1) vectorMultiply _dangerZoneRange * tan _dangerZoneAngle), + [1, 1, 0, 1] +] call EFUNC(common, addLineToDebugDraw); +[ _position, + _position vectorAdd (_direction vectorMultiply _dangerZoneRange) vectorDiff ((_ref select 1) vectorMultiply _dangerZoneRange * tan _dangerZoneAngle), + [1, 1, 0, 1] +] call EFUNC(common, addLineToDebugDraw); +[ _position, + _position vectorAdd (_direction vectorMultiply _dangerZoneRange) vectorAdd ((_ref select 2) vectorMultiply _dangerZoneRange * tan _dangerZoneAngle), + [1, 1, 0, 1] +] call EFUNC(common, addLineToDebugDraw); +[ _position, + _position vectorAdd (_direction vectorMultiply _dangerZoneRange) vectorDiff ((_ref select 2) vectorMultiply _dangerZoneRange * tan _dangerZoneAngle), + [1, 1, 0, 1] +] call EFUNC(common, addLineToDebugDraw); -#endif +#endif \ No newline at end of file From e19ee0e8d84b456a83a519c1bb7b61bf3b50f41a Mon Sep 17 00:00:00 2001 From: Bluefield Date: Sun, 13 Oct 2024 16:55:43 +0200 Subject: [PATCH 03/29] feat: overpressure slider it works fine now --- addons/overpressure/cfgEden.hpp | 2 +- addons/overpressure/functions/fnc_firedEHOP.sqf | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/overpressure/cfgEden.hpp b/addons/overpressure/cfgEden.hpp index 94098852d9a..6aacec77234 100644 --- a/addons/overpressure/cfgEden.hpp +++ b/addons/overpressure/cfgEden.hpp @@ -37,7 +37,7 @@ class Cfg3DEN { control = QGVAR(slider); displayName = CSTRING(Overpressure_distanceCoefficient_displayName); tooltip = CSTRING(Overpressure_distanceCoefficient_toolTip); - expression = QUOTE(if (_value >= 0.1) then {_this setVariable [ARR_3(QQEGVAR(overpressure,distance),_value,true)]}); // ace_overpressure_distance + expression = QUOTE(if (_value >= 0.1) then {_this setVariable [ARR_3(QQEGVAR(overpressure,distance),_value,true)]});// Will return if the slider is not set. NEEDS CHECKING! typeName = "NUMBER"; condition = "objectVehicle"; defaultValue = 0; diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index 3ae4bd55cfb..ee2546b46d3 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -23,10 +23,9 @@ private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues) _opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"]; -private _unitCoef = _unit getVariable [QEGVAR(overpressure,distance), GVAR(overpressureDistanceCoefficient)]; -systemChat format ["coef = %1", _unitCoef]; +private _unitCoef = _unit getVariable [QEGVAR(overpressure,distance), GVAR(overpressureDistanceCoefficient)]; // Because server setting is we fall back to server settings. + -// We check the unitCoef this time. _dangerZoneRange = _dangerZoneRange * _unitCoef; TRACE_3("cache",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage); From 365877ed3535232a89575a382fe9ceacdcd9f86a Mon Sep 17 00:00:00 2001 From: Bluefield Date: Sun, 13 Oct 2024 17:00:57 +0200 Subject: [PATCH 04/29] style: remove macro padding --- addons/overpressure/functions/fnc_firedEHOP.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index ee2546b46d3..a7a3ac52ac0 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -16,7 +16,7 @@ */ // IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; -TRACE_8("firedEH:", _unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _gunner); +TRACE_8("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_gunner); // Retrieve overpressure values private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues); From db5bdee5c2fea6e93fb12ceb691419a5e8a98c55 Mon Sep 17 00:00:00 2001 From: Bluefield Date: Sun, 13 Oct 2024 17:01:26 +0200 Subject: [PATCH 05/29] doc: fix typo --- addons/overpressure/functions/fnc_firedEHOP.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index a7a3ac52ac0..8a5b2aa64fa 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -23,7 +23,7 @@ private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues) _opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"]; -private _unitCoef = _unit getVariable [QEGVAR(overpressure,distance), GVAR(overpressureDistanceCoefficient)]; // Because server setting is we fall back to server settings. +private _unitCoef = _unit getVariable [QEGVAR(overpressure,distance), GVAR(overpressureDistanceCoefficient)]; // Because object attribute slider is we fall back to server settings. _dangerZoneRange = _dangerZoneRange * _unitCoef; From 93cf9750bdce332ce39b4e20cec503007d14e427 Mon Sep 17 00:00:00 2001 From: Bluefield Date: Sun, 13 Oct 2024 17:16:59 +0200 Subject: [PATCH 06/29] lint: fix tabs --- .../overpressure/functions/fnc_firedEHOP.sqf | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index 8a5b2aa64fa..3538e303085 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -44,27 +44,27 @@ private _affected = (ASLToAGL _position) nearEntities ["CAManBase", _dangerZoneR // Draw debug lines #ifdef DEBUG_MODE_FULL -[ _position, - _position vectorAdd (_direction vectorMultiply _dangerZoneRange), - [1, 0, 0, 1] -] call EFUNC(common, addLineToDebugDraw); + [ _position, + _position vectorAdd (_direction vectorMultiply _dangerZoneRange), + [1,0,0,1] + ] call EFUNC(common,addLineToDebugDraw); -private _ref = _direction call EFUNC(common, createOrthonormalReference); -[ _position, - _position vectorAdd (_direction vectorMultiply _dangerZoneRange) vectorAdd ((_ref select 1) vectorMultiply _dangerZoneRange * tan _dangerZoneAngle), - [1, 1, 0, 1] -] call EFUNC(common, addLineToDebugDraw); -[ _position, - _position vectorAdd (_direction vectorMultiply _dangerZoneRange) vectorDiff ((_ref select 1) vectorMultiply _dangerZoneRange * tan _dangerZoneAngle), - [1, 1, 0, 1] -] call EFUNC(common, addLineToDebugDraw); -[ _position, - _position vectorAdd (_direction vectorMultiply _dangerZoneRange) vectorAdd ((_ref select 2) vectorMultiply _dangerZoneRange * tan _dangerZoneAngle), - [1, 1, 0, 1] -] call EFUNC(common, addLineToDebugDraw); -[ _position, - _position vectorAdd (_direction vectorMultiply _dangerZoneRange) vectorDiff ((_ref select 2) vectorMultiply _dangerZoneRange * tan _dangerZoneAngle), - [1, 1, 0, 1] -] call EFUNC(common, addLineToDebugDraw); + private _ref = _direction call EFUNC(common,createOrthonormalReference); + [ _position, + _position vectorAdd (_direction vectorMultiply _dangerZoneRange) vectorAdd ((_ref select 1) vectorMultiply _dangerZoneRange * tan _dangerZoneAngle), + [1,1,0,1] + ] call EFUNC(common,addLineToDebugDraw); + [ _position, + _position vectorAdd (_direction vectorMultiply _dangerZoneRange) vectorDiff ((_ref select 1) vectorMultiply _dangerZoneRange * tan _dangerZoneAngle), + [1,1,0,1] + ] call EFUNC(common,addLineToDebugDraw); + [ _position, + _position vectorAdd (_direction vectorMultiply _dangerZoneRange) vectorAdd ((_ref select 2) vectorMultiply _dangerZoneRange * tan _dangerZoneAngle), + [1,1,0,1] + ] call EFUNC(common,addLineToDebugDraw); + [ _position, + _position vectorAdd (_direction vectorMultiply _dangerZoneRange) vectorDiff ((_ref select 2) vectorMultiply _dangerZoneRange * tan _dangerZoneAngle), + [1,1,0,1] + ] call EFUNC(common,addLineToDebugDraw); #endif \ No newline at end of file From 791022c6cbbd021cbc1dee9e94dbe4a5da8b91db Mon Sep 17 00:00:00 2001 From: Bluefield Date: Sun, 13 Oct 2024 17:23:57 +0200 Subject: [PATCH 07/29] refactor: switch slider attribute to text attribute & add -1 check. --- addons/overpressure/cfgEden.hpp | 38 +++---------------- .../overpressure/functions/fnc_firedEHOP.sqf | 7 +++- 2 files changed, 10 insertions(+), 35 deletions(-) diff --git a/addons/overpressure/cfgEden.hpp b/addons/overpressure/cfgEden.hpp index 6aacec77234..65cde9c63eb 100644 --- a/addons/overpressure/cfgEden.hpp +++ b/addons/overpressure/cfgEden.hpp @@ -1,46 +1,18 @@ class Cfg3DEN { - class Attributes { - class Slider; - class GVAR(slider): Slider { - attributeLoad = "params [""_ctrlGroup""];\ - private _slider = _ctrlGroup controlsGroupCtrl 100;\ - private _edit = _ctrlGroup controlsGroupCtrl 101;\ - _slider sliderSetPosition _value;\ - _edit ctrlSetText ([_value, 1, 1] call CBA_fnc_formatNumber);"; - attributeSave = "params [""_ctrlGroup""];\ - sliderPosition (_ctrlGroup controlsGroupCtrl 100); "; - onLoad = "params [""_ctrlGroup""];\ - private _slider = _ctrlGroup controlsGroupCtrl 100;\ - private _edit = _ctrlGroup controlsGroupCtrl 101;\ - _slider sliderSetRange [0, 10];\ - _slider ctrlAddEventHandler [""SliderPosChanged"", {\ - params [""_slider""];\ - private _edit = (ctrlParentControlsGroup _slider) controlsGroupCtrl 101;\ - private _value = sliderPosition _slider;\ - _edit ctrlSetText ([_value, 1, 1] call CBA_fnc_formatNumber);\ - }];\ - _edit ctrlAddEventHandler [""KillFocus"", {\ - params [""_edit""];\ - private _slider = (ctrlParentControlsGroup _edit) controlsGroupCtrl 100;\ - private _value = ((parseNumber ctrlText _edit) min 10) max 0;\ - _slider sliderSetPosition _value;\ - _edit ctrlSetText ([_value, 1, 1] call CBA_fnc_formatNumber);\ - }];"; - }; - }; class Object { class AttributeCategories { class ace_attributes { class Attributes { class GVAR(overPressureDistanceSetting) { - property = QUOTE(overpressureDistanceCoefficient); - control = QGVAR(slider); displayName = CSTRING(Overpressure_distanceCoefficient_displayName); tooltip = CSTRING(Overpressure_distanceCoefficient_toolTip); - expression = QUOTE(if (_value >= 0.1) then {_this setVariable [ARR_3(QQEGVAR(overpressure,distance),_value,true)]});// Will return if the slider is not set. NEEDS CHECKING! + property = QUOTE(overpressureDistanceCoefficient); + control = "Edit"; + expression = QUOTE(_this setVariable [ARR_3(QQEGVAR(overpressure,distance),_value,true)]); + defaultValue = -1; + validate = "number"; typeName = "NUMBER"; condition = "objectVehicle"; - defaultValue = 0; }; }; }; diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index 3538e303085..5004ede5c99 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -23,10 +23,13 @@ private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues) _opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"]; -private _unitCoef = _unit getVariable [QEGVAR(overpressure,distance), GVAR(overpressureDistanceCoefficient)]; // Because object attribute slider is we fall back to server settings. +private _unitOverpressureRangeAttribute = _unit getVariable QEGVAR(overpressure,distance); +// If -1 (disabled) we return to server value, otherwise we use the given value. +if(_unitOverpressureRangeAttribute == -1) then { _unitOverpressureRangeAttribute = GVAR(overpressureDistanceCoefficient); }; -_dangerZoneRange = _dangerZoneRange * _unitCoef; + +_dangerZoneRange = _dangerZoneRange * _unitOverpressureRangeAttribute; TRACE_3("cache",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage); From 1f613f0457535cb394fa0924dc089847fda0f0af Mon Sep 17 00:00:00 2001 From: Bluefield Date: Sun, 13 Oct 2024 18:01:34 +0200 Subject: [PATCH 08/29] fix: change to localized strings --- addons/overpressure/cfgEden.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/overpressure/cfgEden.hpp b/addons/overpressure/cfgEden.hpp index 65cde9c63eb..6e75054cdff 100644 --- a/addons/overpressure/cfgEden.hpp +++ b/addons/overpressure/cfgEden.hpp @@ -4,8 +4,8 @@ class Cfg3DEN { class ace_attributes { class Attributes { class GVAR(overPressureDistanceSetting) { - displayName = CSTRING(Overpressure_distanceCoefficient_displayName); - tooltip = CSTRING(Overpressure_distanceCoefficient_toolTip); + displayName = LSTRING(Overpressure_distanceCoefficient_displayName); + tooltip = LSTRING(Overpressure_distanceCoefficient_toolTip); property = QUOTE(overpressureDistanceCoefficient); control = "Edit"; expression = QUOTE(_this setVariable [ARR_3(QQEGVAR(overpressure,distance),_value,true)]); From 6285a185120412c12f71d9fb0487a6023dfe95c0 Mon Sep 17 00:00:00 2001 From: Bluefield Date: Sun, 13 Oct 2024 18:05:48 +0200 Subject: [PATCH 09/29] fix: typo --- addons/overpressure/cfgEden.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/overpressure/cfgEden.hpp b/addons/overpressure/cfgEden.hpp index 6e75054cdff..73ddf40b16e 100644 --- a/addons/overpressure/cfgEden.hpp +++ b/addons/overpressure/cfgEden.hpp @@ -4,8 +4,8 @@ class Cfg3DEN { class ace_attributes { class Attributes { class GVAR(overPressureDistanceSetting) { - displayName = LSTRING(Overpressure_distanceCoefficient_displayName); - tooltip = LSTRING(Overpressure_distanceCoefficient_toolTip); + displayName = LSTRING(distanceCoefficient_displayName); + tooltip = LSTRING(distanceCoefficient_toolTip); property = QUOTE(overpressureDistanceCoefficient); control = "Edit"; expression = QUOTE(_this setVariable [ARR_3(QQEGVAR(overpressure,distance),_value,true)]); From dcbedf05cabce31b39d341a10b74f9777850eb37 Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Sun, 13 Oct 2024 18:07:45 +0200 Subject: [PATCH 10/29] Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/overpressure/functions/fnc_firedEHOP.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index 5004ede5c99..1ced07dbd12 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -70,4 +70,4 @@ private _affected = (ASLToAGL _position) nearEntities ["CAManBase", _dangerZoneR [1,1,0,1] ] call EFUNC(common,addLineToDebugDraw); -#endif \ No newline at end of file +#endif From b10cd7690c0eafd71c940f171dad5d29718bd0d5 Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Sun, 13 Oct 2024 18:08:53 +0200 Subject: [PATCH 11/29] Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/overpressure/functions/fnc_firedEHOP.sqf | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index 1ced07dbd12..5eb8097a6d0 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -27,8 +27,6 @@ private _unitOverpressureRangeAttribute = _unit getVariable QEGVAR(overpressure, // If -1 (disabled) we return to server value, otherwise we use the given value. if(_unitOverpressureRangeAttribute == -1) then { _unitOverpressureRangeAttribute = GVAR(overpressureDistanceCoefficient); }; - - _dangerZoneRange = _dangerZoneRange * _unitOverpressureRangeAttribute; TRACE_3("cache",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage); From 92b8b8b0167df07cc03c5815c623b5962a5f8d29 Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Sun, 13 Oct 2024 18:09:00 +0200 Subject: [PATCH 12/29] Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/overpressure/functions/fnc_firedEHOP.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index 5eb8097a6d0..cef65696dd0 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -15,7 +15,7 @@ * Public: No */ -// IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; +//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; TRACE_8("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_gunner); // Retrieve overpressure values From 1cb0ce025d6c25d6f5ac8b0242110bee975c9fdb Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Sun, 13 Oct 2024 18:09:07 +0200 Subject: [PATCH 13/29] Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/overpressure/functions/fnc_firedEHOP.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index cef65696dd0..9a196cf3ff1 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -37,7 +37,7 @@ if (_dangerZoneDamage <= 0) exitWith {}; private _position = getPosASL _projectile; private _direction = vectorDir _projectile; -// damage to others +// Damage to others private _affected = (ASLToAGL _position) nearEntities ["CAManBase", _dangerZoneRange]; // Let each client handle their own affected units From c2273e915889bf73af45088d1bc54613803648a3 Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Sun, 13 Oct 2024 18:09:56 +0200 Subject: [PATCH 14/29] Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/overpressure/functions/fnc_firedEHOP.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index 9a196cf3ff1..6bd63d59a57 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -26,7 +26,7 @@ _opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"]; private _unitOverpressureRangeAttribute = _unit getVariable QEGVAR(overpressure,distance); // If -1 (disabled) we return to server value, otherwise we use the given value. -if(_unitOverpressureRangeAttribute == -1) then { _unitOverpressureRangeAttribute = GVAR(overpressureDistanceCoefficient); }; +if(_unitOverpressureRangeAttribute < 0) then { _unitOverpressureRangeAttribute = GVAR(overpressureDistanceCoefficient); }; _dangerZoneRange = _dangerZoneRange * _unitOverpressureRangeAttribute; TRACE_3("cache",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage); From 9f85f2c584ef7ad73b5d08798d349b9c8370813d Mon Sep 17 00:00:00 2001 From: Bluefield Date: Sun, 13 Oct 2024 18:10:44 +0200 Subject: [PATCH 15/29] feat: rename CfgEden --- addons/overpressure/cfgEden.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/overpressure/cfgEden.hpp b/addons/overpressure/cfgEden.hpp index 73ddf40b16e..3823ba0a69e 100644 --- a/addons/overpressure/cfgEden.hpp +++ b/addons/overpressure/cfgEden.hpp @@ -4,8 +4,8 @@ class Cfg3DEN { class ace_attributes { class Attributes { class GVAR(overPressureDistanceSetting) { - displayName = LSTRING(distanceCoefficient_displayName); - tooltip = LSTRING(distanceCoefficient_toolTip); + displayName = CSTRING(distanceCoefficient_displayName); + tooltip = CSTRING(distanceCoefficient_toolTip); property = QUOTE(overpressureDistanceCoefficient); control = "Edit"; expression = QUOTE(_this setVariable [ARR_3(QQEGVAR(overpressure,distance),_value,true)]); @@ -18,4 +18,4 @@ class Cfg3DEN { }; }; }; -}; +}; \ No newline at end of file From b6aae55c0b87587ea1da198d60c11a5f69aeb164 Mon Sep 17 00:00:00 2001 From: Bluefield Date: Sun, 13 Oct 2024 18:11:23 +0200 Subject: [PATCH 16/29] Rename: part 1 --- addons/overpressure/{cfgEden.hpp => CfgEden1.hpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename addons/overpressure/{cfgEden.hpp => CfgEden1.hpp} (100%) diff --git a/addons/overpressure/cfgEden.hpp b/addons/overpressure/CfgEden1.hpp similarity index 100% rename from addons/overpressure/cfgEden.hpp rename to addons/overpressure/CfgEden1.hpp From 21c892aef6e84483d8b188c4195e67836071a7cf Mon Sep 17 00:00:00 2001 From: Bluefield Date: Sun, 13 Oct 2024 18:11:48 +0200 Subject: [PATCH 17/29] Rename: Part 2 --- addons/overpressure/{CfgEden1.hpp => CfgEden.hpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename addons/overpressure/{CfgEden1.hpp => CfgEden.hpp} (100%) diff --git a/addons/overpressure/CfgEden1.hpp b/addons/overpressure/CfgEden.hpp similarity index 100% rename from addons/overpressure/CfgEden1.hpp rename to addons/overpressure/CfgEden.hpp From 9865705c1e740a157e4003c6b7830dea24d7dc23 Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Sun, 13 Oct 2024 18:12:37 +0200 Subject: [PATCH 18/29] Update addons/overpressure/CfgEden.hpp Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/overpressure/CfgEden.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/overpressure/CfgEden.hpp b/addons/overpressure/CfgEden.hpp index 3823ba0a69e..18bcb88aaa4 100644 --- a/addons/overpressure/CfgEden.hpp +++ b/addons/overpressure/CfgEden.hpp @@ -18,4 +18,4 @@ class Cfg3DEN { }; }; }; -}; \ No newline at end of file +}; From 07df1605e7d8b17afbb55844ae8066fbea401855 Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Sun, 13 Oct 2024 18:17:02 +0200 Subject: [PATCH 19/29] Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/overpressure/functions/fnc_firedEHOP.sqf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index 6bd63d59a57..d71cb7a4066 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -26,8 +26,7 @@ _opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"]; private _unitOverpressureRangeAttribute = _unit getVariable QEGVAR(overpressure,distance); // If -1 (disabled) we return to server value, otherwise we use the given value. -if(_unitOverpressureRangeAttribute < 0) then { _unitOverpressureRangeAttribute = GVAR(overpressureDistanceCoefficient); }; -_dangerZoneRange = _dangerZoneRange * _unitOverpressureRangeAttribute; +_dangerZoneRange = _dangerZoneRange * [_unitOverpressureRangeAttribute, GVAR(overpressureDistanceCoefficient)] select (_unitOverpressureRangeAttribute < 0); TRACE_3("cache",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage); From bdef984a7cc8f8e639c8328ad81759c97f66fa86 Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Sun, 13 Oct 2024 18:19:34 +0200 Subject: [PATCH 20/29] Update fnc_firedEHOP.sqf Signed-off-by: bluefield <59333909+bluefieldcreator@users.noreply.github.com> --- .../overpressure/functions/fnc_firedEHOP.sqf | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index d71cb7a4066..ea8bd344054 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -1,18 +1,18 @@ #include "..\script_component.hpp" /* * Author: joko // Jonas - * Handle fire of vehicle weapons. Called from the unified fired EH only for the local player vehicle. - * - * Arguments: - * None. Parameters inherited from EFUNC(common, firedEH) - * - * Return Value: - * None - * - * Example: - * [tank, "cannon_125mm", "cannon_125mm", "player", "Sh_125mm_APFSDS_T_Green", "24Rnd_125mm_APFSDS_T_Green", projectile] call ace_overpressure_fnc_firedEHOP - * - * Public: No + * Handle fire of Vehicle Weapons. Called from the unified fired EH only for the local player vehicle. + * + * Arguments: + * None. Parameters inherited from EFUNC(common,firedEH) + * + * Return Value: + * None + * + * Example: + * [tank, "cannon_125mm", "cannon_125mm", "player", "Sh_125mm_APFSDS_T_Green", "24Rnd_125mm_APFSDS_T_Green", projectile] call ace_overpressure_fnc_firedEHOP + * + * Public: No */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; From 2ae3b15c550785c0c1eabf6ad3d7e86d0d9eea1c Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Mon, 14 Oct 2024 02:03:53 +0200 Subject: [PATCH 21/29] Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/overpressure/functions/fnc_firedEHOP.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index ea8bd344054..087b04dac72 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -23,7 +23,7 @@ private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues) _opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"]; -private _unitOverpressureRangeAttribute = _unit getVariable QEGVAR(overpressure,distance); +private _unitOverpressureRangeAttribute = _unit getVariable [QEGVAR(overpressure,distance), -1]; // If -1 (disabled) we return to server value, otherwise we use the given value. _dangerZoneRange = _dangerZoneRange * [_unitOverpressureRangeAttribute, GVAR(overpressureDistanceCoefficient)] select (_unitOverpressureRangeAttribute < 0); From 773eab5409dc05959a9a29c0fe513f8f7419fb41 Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Mon, 14 Oct 2024 02:04:03 +0200 Subject: [PATCH 22/29] Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/overpressure/functions/fnc_firedEHOP.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index 087b04dac72..6428fefa44a 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -26,7 +26,7 @@ _opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"]; private _unitOverpressureRangeAttribute = _unit getVariable [QEGVAR(overpressure,distance), -1]; // If -1 (disabled) we return to server value, otherwise we use the given value. -_dangerZoneRange = _dangerZoneRange * [_unitOverpressureRangeAttribute, GVAR(overpressureDistanceCoefficient)] select (_unitOverpressureRangeAttribute < 0); +_dangerZoneRange = _dangerZoneRange * ([_unitOverpressureRangeAttribute, GVAR(overpressureDistanceCoefficient)] select (_unitOverpressureRangeAttribute < 0)); TRACE_3("cache",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage); From 8525e822c7243a70d2019a3217882ef9db853fa2 Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Sat, 19 Oct 2024 19:08:21 +0200 Subject: [PATCH 23/29] Update config.cpp Signed-off-by: bluefield <59333909+bluefieldcreator@users.noreply.github.com> --- addons/overpressure/config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/overpressure/config.cpp b/addons/overpressure/config.cpp index 238acb8e8c6..f4e128c1862 100644 --- a/addons/overpressure/config.cpp +++ b/addons/overpressure/config.cpp @@ -8,7 +8,7 @@ class CfgPatches { requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author = ECSTRING(common,ACETeam); - authors[] = {"commy2","KoffeinFlummi","esteldunedain", "bluefield"}; + authors[] = {"commy2","KoffeinFlummi","esteldunedain"}; url = ECSTRING(main,URL); VERSION_CONFIG; }; From e1ee5730b8168ee40c8e3640794f8c41a60a2919 Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Sat, 19 Oct 2024 19:09:19 +0200 Subject: [PATCH 24/29] Update AUTHORS.txt Signed-off-by: bluefield <59333909+bluefieldcreator@users.noreply.github.com> --- AUTHORS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.txt b/AUTHORS.txt index 3cf263bb2a4..90891432eff 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -64,6 +64,7 @@ Barman75 Bla1337 BlackPixxel BlackQwar +Bluefield Brakoviejo Brisse Brostrom.A | Evul From 965429fa0ee23953a10db8ace082f030d4f80a5f Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Sat, 19 Oct 2024 19:09:56 +0200 Subject: [PATCH 25/29] Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: PabstMirror --- addons/overpressure/functions/fnc_firedEHOP.sqf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index 6428fefa44a..9cc76b65456 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -25,8 +25,7 @@ _opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"]; private _unitOverpressureRangeAttribute = _unit getVariable [QEGVAR(overpressure,distance), -1]; -// If -1 (disabled) we return to server value, otherwise we use the given value. -_dangerZoneRange = _dangerZoneRange * ([_unitOverpressureRangeAttribute, GVAR(overpressureDistanceCoefficient)] select (_unitOverpressureRangeAttribute < 0)); +_dangerZoneRange = _dangerZoneRange * _unitOverpressureRangeAttribute; TRACE_3("cache",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage); From 144bdd683b5e90d66950120cbff0735daa5c0516 Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Sat, 19 Oct 2024 19:11:51 +0200 Subject: [PATCH 26/29] Update addons/overpressure/CfgEden.hpp Co-authored-by: PabstMirror --- addons/overpressure/CfgEden.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/overpressure/CfgEden.hpp b/addons/overpressure/CfgEden.hpp index 18bcb88aaa4..64a06eadd58 100644 --- a/addons/overpressure/CfgEden.hpp +++ b/addons/overpressure/CfgEden.hpp @@ -8,7 +8,7 @@ class Cfg3DEN { tooltip = CSTRING(distanceCoefficient_toolTip); property = QUOTE(overpressureDistanceCoefficient); control = "Edit"; - expression = QUOTE(_this setVariable [ARR_3(QQEGVAR(overpressure,distance),_value,true)]); + expression = QUOTE(if (_value >= 0) then { _this setVariable [ARR_3(QQGVAR(distance),_value,true)] }); defaultValue = -1; validate = "number"; typeName = "NUMBER"; From 6b963d957dcbfb95132a3b7266a32c007a10acf0 Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Sat, 19 Oct 2024 19:12:16 +0200 Subject: [PATCH 27/29] Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: PabstMirror --- addons/overpressure/functions/fnc_firedEHOP.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index 9cc76b65456..685abba2b72 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -23,7 +23,7 @@ private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues) _opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"]; -private _unitOverpressureRangeAttribute = _unit getVariable [QEGVAR(overpressure,distance), -1]; +private _unitOverpressureRangeAttribute = _unit getVariable [QEGVAR(overpressure,distance), GVAR(overpressureDistanceCoefficient)]; _dangerZoneRange = _dangerZoneRange * _unitOverpressureRangeAttribute; From 152115ac1ee587e7260b8b8477c6aef718ce9c25 Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Sat, 19 Oct 2024 19:13:42 +0200 Subject: [PATCH 28/29] Update fnc_firedEHOP.sqf Signed-off-by: bluefield <59333909+bluefieldcreator@users.noreply.github.com> --- addons/overpressure/functions/fnc_firedEHOP.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index 685abba2b72..a750e897d7d 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -25,7 +25,7 @@ _opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"]; private _unitOverpressureRangeAttribute = _unit getVariable [QEGVAR(overpressure,distance), GVAR(overpressureDistanceCoefficient)]; -_dangerZoneRange = _dangerZoneRange * _unitOverpressureRangeAttribute; +_dangerZoneRange = _dangerZoneRange * ([_unitOverpressureRangeAttribute, GVAR(overpressureDistanceCoefficient)] select (_unitOverpressureRangeAttribute < 0)); TRACE_3("cache",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage); From 7102c9c26e86d812a5e2504f73065e7f14053846 Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Mon, 21 Oct 2024 01:26:00 +0200 Subject: [PATCH 29/29] Update fnc_firedEHOP.sqf Signed-off-by: bluefield <59333909+bluefieldcreator@users.noreply.github.com> --- addons/overpressure/functions/fnc_firedEHOP.sqf | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index a750e897d7d..35aa54d4e80 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -23,14 +23,13 @@ private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues) _opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"]; -private _unitOverpressureRangeAttribute = _unit getVariable [QEGVAR(overpressure,distance), GVAR(overpressureDistanceCoefficient)]; - -_dangerZoneRange = _dangerZoneRange * ([_unitOverpressureRangeAttribute, GVAR(overpressureDistanceCoefficient)] select (_unitOverpressureRangeAttribute < 0)); - TRACE_3("cache",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage); if (_dangerZoneDamage <= 0) exitWith {}; +private _unitOverpressureRangeAttribute = _unit getVariable [QGVAR(distance), GVAR(overpressureDistanceCoefficient)]; +_dangerZoneRange = _dangerZoneRange * _unitOverpressureRangeAttribute; + // The weapon produces overpressure, calculate private _position = getPosASL _projectile; private _direction = vectorDir _projectile;