diff --git a/addons/overpressure/ACE_Settings.hpp b/addons/overpressure/ACE_Settings.hpp
deleted file mode 100644
index d46cae7498..0000000000
--- a/addons/overpressure/ACE_Settings.hpp
+++ /dev/null
@@ -1,5 +0,0 @@
-class ACE_Settings {
- class GVAR(distanceCoefficient) {
- movedToSQF = 1;
- };
-};
diff --git a/addons/overpressure/XEH_postInit.sqf b/addons/overpressure/XEH_postInit.sqf
index 46fe460268..4b014e89e2 100644
--- a/addons/overpressure/XEH_postInit.sqf
+++ b/addons/overpressure/XEH_postInit.sqf
@@ -1,14 +1,17 @@
#include "script_component.hpp"
["CBA_settingsInitialized", {
- TRACE_1("settingsInit eh",GVAR(distanceCoefficient));
- if (GVAR(distanceCoefficient) <= 0) exitWith {};
+ TRACE_2("settingsInit eh",GVAR(backblastDistanceCoefficient),GVAR(overpressureDistanceCoefficient));
["ace_overpressure", LINKFUNC(overpressureDamage)] call CBA_fnc_addEventHandler;
- // Register fire event handler
- ["ace_firedPlayer", LINKFUNC(firedEHBB)] call CBA_fnc_addEventHandler;
- ["ace_firedPlayerVehicle", LINKFUNC(firedEHOP)] call CBA_fnc_addEventHandler;
+ // Register fire event handlers
+ if (GVAR(backblastDistanceCoefficient) > 0) then {
+ ["ace_firedPlayer", LINKFUNC(firedEHBB)] call CBA_fnc_addEventHandler;
+ };
+ if (GVAR(overpressureDistanceCoefficient) > 0) then {
+ ["ace_firedPlayerVehicle", LINKFUNC(firedEHOP)] call CBA_fnc_addEventHandler;
+ };
GVAR(cacheHash) = createHashMap;
}] call CBA_fnc_addEventHandler;
diff --git a/addons/overpressure/config.cpp b/addons/overpressure/config.cpp
index 3815cc831f..7274cd5059 100644
--- a/addons/overpressure/config.cpp
+++ b/addons/overpressure/config.cpp
@@ -14,7 +14,6 @@ class CfgPatches {
};
};
-#include "ACE_Settings.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgWeapons.hpp"
#include "ACE_Arsenal_Stats.hpp"
diff --git a/addons/overpressure/functions/fnc_firedEHBB.sqf b/addons/overpressure/functions/fnc_firedEHBB.sqf
index a027785940..05a761bf06 100644
--- a/addons/overpressure/functions/fnc_firedEHBB.sqf
+++ b/addons/overpressure/functions/fnc_firedEHBB.sqf
@@ -22,6 +22,8 @@ TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_veh
private _bbValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues);
_bbValues params ["_backblastAngle", "_backblastRange", "_backblastDamage", "_offset"];
+_backblastRange = _backblastRange * GVAR(backblastDistanceCoefficient);
+
TRACE_4("cache",_backblastAngle,_backblastRange,_backblastDamage,_offset);
if (_backblastDamage <= 0) exitWith {};
diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf
index 2345d09327..e011098b59 100644
--- a/addons/overpressure/functions/fnc_firedEHOP.sqf
+++ b/addons/overpressure/functions/fnc_firedEHOP.sqf
@@ -22,6 +22,8 @@ TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_veh
private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues);
_opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"];
+_dangerZoneRange = _dangerZoneRange * GVAR(overpressureDistanceCoefficient);
+
TRACE_3("cache",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage);
if (_dangerZoneDamage <= 0) exitWith {};
diff --git a/addons/overpressure/functions/fnc_getOverPressureValues.sqf b/addons/overpressure/functions/fnc_getOverPressureValues.sqf
index 4372d4c8e6..374e9de9d6 100644
--- a/addons/overpressure/functions/fnc_getOverPressureValues.sqf
+++ b/addons/overpressure/functions/fnc_getOverPressureValues.sqf
@@ -54,7 +54,7 @@ TRACE_1("ConfigPath",_config);
// get the Variables out of the Configs and populate return array with them
_return = [
(getNumber (_config >> QGVAR(angle))),
- (getNumber (_config >> QGVAR(range))) * GVAR(distanceCoefficient),
+ (getNumber (_config >> QGVAR(range))),
(getNumber (_config >> QGVAR(damage))),
(getNumber (_config >> QGVAR(offset)))
];
diff --git a/addons/overpressure/initSettings.inc.sqf b/addons/overpressure/initSettings.inc.sqf
index 7fe6401131..ece1230dcc 100644
--- a/addons/overpressure/initSettings.inc.sqf
+++ b/addons/overpressure/initSettings.inc.sqf
@@ -1,9 +1,23 @@
private _category = [LELSTRING(common,categoryUncategorized), LLSTRING(DisplayName)];
[
- QGVAR(distanceCoefficient), "SLIDER",
+ QGVAR(overpressureDistanceCoefficient),
+ "SLIDER",
[LSTRING(distanceCoefficient_displayName), LSTRING(distanceCoefficient_toolTip)],
_category,
- [-1, 10, 1, 1],
- 1
+ [0, 10, 1, 1],
+ 1,
+ {[QGVAR(overpressureDistanceCoefficient), _this] call EFUNC(common,cbaSettings_settingChanged)},
+ true // Needs mission restart
+] call CBA_fnc_addSetting;
+
+[
+ QGVAR(backblastDistanceCoefficient),
+ "SLIDER",
+ [LSTRING(backblastDistanceCoefficient_displayName), LSTRING(backblastDistanceCoefficient_toolTip)],
+ _category,
+ [0, 10, 1, 1],
+ 1,
+ {[QGVAR(backblastDistanceCoefficient), _this] call EFUNC(common,cbaSettings_settingChanged)},
+ true // Needs mission restart
] call CBA_fnc_addSetting;
diff --git a/addons/overpressure/stringtable.xml b/addons/overpressure/stringtable.xml
index caade38c3d..d8b9ad12f4 100644
--- a/addons/overpressure/stringtable.xml
+++ b/addons/overpressure/stringtable.xml
@@ -30,20 +30,26 @@
Coeficiente de distancia de sobrepresión
- Scales the overpressure effect [Default: 1]
- Stellt den Koeffizient für die Überdruckentfernung ein [Standard: 1]
- 過圧効果の範囲 [デフォルト: 1]
- 과중압력의 효과 크기 [기본설정: 1]
- Skaluje efekt nadciśnienia [Domyślne: 1]
- Ajuste l'effet de surpression. Valeur par défaut : 1.
- Scala l'effetto di sovrapressione [Predefinito: 1]
- 超压影响的范围 [预设:1]
- 高壓影響的範圍 [預設: 1]
- Степень зависимости избыточного давления от расстояния [По умолчанию: 1]
- Escala o efeito de sobrepressão [Padrão: 1]
- Állítja a túlnyomás hatását [Alapértelmezett: 1]
- Nastavuje jak velký je efekt přetlaku [Standard: 1]
- Escala el efecto de sobrepresión [Predeterminado: 1]
+ Scales the overpressure effect
+ Stellt den Koeffizient für die Überdruckentfernung ein
+ 過圧効果の範囲
+ 과중압력의 효과 크기
+ Skaluje efekt nadciśnienia
+ Ajuste l'effet de surpression
+ Scala l'effetto di sovrapressione
+ 超压影响的范围
+ 高壓影響的範圍
+ Степень зависимости избыточного давления от расстояния
+ Escala o efeito de sobrepressão
+ Állítja a túlnyomás hatását
+ Nastavuje jak velký je efekt přetlaku
+ Escala el efecto de sobrepresión
+
+
+ Backblast Distance Coefficient
+
+
+ Scales the backblast effect
Backblast range