diff --git a/addons/common/ACE_ExtensionsHashes.hpp b/addons/common/ACE_ExtensionsHashes.hpp
new file mode 100644
index 00000000000..74fe4defab1
--- /dev/null
+++ b/addons/common/ACE_ExtensionsHashes.hpp
@@ -0,0 +1,6 @@
+class ACE_ExtensionsHashes {
+ class ace {
+ dll = "b83c2c9c7c989eaf888c885d13a2fdf4a61d1c5f";
+ dll_x64 = "356a61c4bd2aa13556a8ba0b467c819b3b438d6c";
+ };
+};
diff --git a/addons/common/config.cpp b/addons/common/config.cpp
index f7b27ce3749..f94b1d376cd 100644
--- a/addons/common/config.cpp
+++ b/addons/common/config.cpp
@@ -75,3 +75,5 @@ class ACE_Tests {
mapConfigs = QPATHTOF(dev\test_mapConfigs.sqf);
cfgPatches = QPATHTOF(dev\test_cfgPatches.sqf);
};
+
+#include "ACE_ExtensionsHashes.hpp"
diff --git a/addons/common/functions/fnc_checkFiles.sqf b/addons/common/functions/fnc_checkFiles.sqf
index 13ad27a7cb5..8ae67eb04a0 100644
--- a/addons/common/functions/fnc_checkFiles.sqf
+++ b/addons/common/functions/fnc_checkFiles.sqf
@@ -116,31 +116,52 @@ if (_oldCompats isNotEqualTo []) then {
///////////////
// Check extensions
///////////////
-private _platform = toLowerANSI (productVersion select 6);
+if (hasInterface) then {
+ private _platform = toLowerANSI (productVersion select 6);
-if (_platform in ["linux", "osx"]) then {
- // Linux and OSX client ports do not support extensions at all
- if (hasInterface) then {
+ // Check for presence
+ if (_platform in ["linux", "osx"]) exitWith {
+ // Linux and OSX client ports do not support extensions at all
WARNING("Operating system does not support extensions");
- } else {
- INFO("Operating system does not support extensions");
};
-} else {
+
("ace" callExtension ["version", []]) params [["_versionEx", "", [""]], ["_returnCode", -1, [-1]]];
if (_returnCode != 0 || {_versionEx == ""}) then {
private _errorMsg = format ["Extension not found. [Return Code: %1]", _returnCode];
ERROR(_errorMsg);
-
- if (hasInterface) then {
- ["[ACE] ERROR", _errorMsg] call FUNC(errorMessage);
- };
+ ["[ACE] ERROR", _errorMsg] call FUNC(errorMessage);
} else {
_versionEx = _versionEx select [0, 8]; // git hash
INFO_1("Extension [Version: %1]",_versionEx);
};
-};
+ // Check for correct hash
+ if (GVAR(checkExtensions)) then {
+ private _allExtensions = allExtensions;
+
+ {
+ private _extName = configName _x;
+ private _extensionType = "dll";
+ if (productVersion select 7 == "x64") then { _extensionType = format ["%1_x64", _extensionType]; };
+ private _expectedHash = getText (_x >> _extensionType);
+
+ private _extensionHash = "";
+ {
+ if ((_x getOrDefault ["name", ""]) == _extName) exitWith {
+ _extensionHash = _x getOrDefault ["hash", ""];
+ };
+ } forEach _allExtensions;
+ TRACE_3("",_extName,_expectedHash,_extensionHash);
+
+ if (_extensionHash != _expectedHash) then {
+ private _errorMsg = format ["Extension %1 wrong version [%2 vs %3].", _extName, _extensionHash, _expectedHash];
+ ERROR(_errorMsg);
+ ["[ACE] ERROR", _errorMsg] call FUNC(errorMessage);
+ };
+ } forEach ("true" configClasses (configFile >> "ACE_ExtensionsHashes"));
+ };
+};
///////////////
// Check server version/addons
diff --git a/addons/common/initSettings.inc.sqf b/addons/common/initSettings.inc.sqf
index 4b3a2fd9c9d..a0a495b094e 100644
--- a/addons/common/initSettings.inc.sqf
+++ b/addons/common/initSettings.inc.sqf
@@ -29,6 +29,15 @@ private _categorySway = [_category, LSTRING(subcategory_sway)];
1
] call CBA_fnc_addSetting;
+[
+ QGVAR(checkExtensions),
+ "CHECKBOX",
+ [LSTRING(checkExtensions_DisplayName)],
+ _category,
+ false,
+ 1
+] call CBA_fnc_addSetting;
+
[
QGVAR(settingFeedbackIcons),
"LIST",
diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml
index fa26901e46b..ece8ece410d 100644
--- a/addons/common/stringtable.xml
+++ b/addons/common/stringtable.xml
@@ -409,6 +409,9 @@
检查 PBO
PBO-k ellenőrzése
+
+ Check Extensions
+
What addons are allowed regardless?
Jaké addony jsou povoleny?
diff --git a/addons/compat_ef/CfgWeapons.hpp b/addons/compat_ef/CfgWeapons.hpp
index 1b2cd4c3fe5..33fa1c41d2d 100644
--- a/addons/compat_ef/CfgWeapons.hpp
+++ b/addons/compat_ef/CfgWeapons.hpp
@@ -7,25 +7,6 @@ class CfgWeapons {
EGVAR(nightvision,border) = QPATHTOEF(nightvision,data\nvg_mask_binos_4096.paa);
};
- // -- ace_hearing --
- class HelmetBase;
- class EF_H_Protecta: HelmetBase {
- HEARING_PROTECTION_PELTOR;
- };
- class EF_H_MCH; // this does not have peltor
- class EF_H_MCH_Basic: EF_H_MCH {
- HEARING_PROTECTION_PELTOR;
- };
- class EF_H_MCH_BasicNet_Des: EF_H_MCH {
- HEARING_PROTECTION_PELTOR;
- };
- class EF_H_MCH_Full: EF_H_MCH {
- HEARING_PROTECTION_PELTOR;
- };
- class EF_H_MCH_FullCamo_Des: EF_H_MCH {
- HEARING_PROTECTION_PELTOR;
- };
-
// -- ace_overpressure --
class autocannon_30mm;
class EF_autocannon_50mm_AAV9: autocannon_30mm {
diff --git a/addons/compat_ef/compat_ef_hearing/CfgWeapons.hpp b/addons/compat_ef/compat_ef_hearing/CfgWeapons.hpp
new file mode 100644
index 00000000000..ece1f54c252
--- /dev/null
+++ b/addons/compat_ef/compat_ef_hearing/CfgWeapons.hpp
@@ -0,0 +1,19 @@
+class CfgWeapons {
+ class HelmetBase;
+ class EF_H_Protecta: HelmetBase {
+ HEARING_PROTECTION_PELTOR;
+ };
+ class EF_H_MCH; // this does not have peltor
+ class EF_H_MCH_Basic: EF_H_MCH {
+ HEARING_PROTECTION_PELTOR;
+ };
+ class EF_H_MCH_BasicNet_Des: EF_H_MCH {
+ HEARING_PROTECTION_PELTOR;
+ };
+ class EF_H_MCH_Full: EF_H_MCH {
+ HEARING_PROTECTION_PELTOR;
+ };
+ class EF_H_MCH_FullCamo_Des: EF_H_MCH {
+ HEARING_PROTECTION_PELTOR;
+ };
+};
diff --git a/addons/compat_ef/compat_ef_hearing/config.cpp b/addons/compat_ef/compat_ef_hearing/config.cpp
new file mode 100644
index 00000000000..c091a27c8fd
--- /dev/null
+++ b/addons/compat_ef/compat_ef_hearing/config.cpp
@@ -0,0 +1,19 @@
+#include "script_component.hpp"
+#include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp"
+
+class CfgPatches {
+ class SUBADDON {
+ name = COMPONENT_NAME;
+ units[] = {};
+ weapons[] = {};
+ requiredVersion = REQUIRED_VERSION;
+ requiredAddons[] = {"EF_Weapons", "EF_Marines", "ace_hearing"};
+ skipWhenMissingDependencies = 1;
+ author = ECSTRING(common,ACETeam);
+ url = ECSTRING(main,URL);
+ VERSION_CONFIG;
+ addonRootClass = QUOTE(ADDON);
+ };
+};
+
+#include "CfgWeapons.hpp"
diff --git a/addons/compat_ef/compat_ef_hearing/script_component.hpp b/addons/compat_ef/compat_ef_hearing/script_component.hpp
new file mode 100644
index 00000000000..8edb825af34
--- /dev/null
+++ b/addons/compat_ef/compat_ef_hearing/script_component.hpp
@@ -0,0 +1,3 @@
+#define SUBCOMPONENT hearing
+#define SUBCOMPONENT_BEAUTIFIED Hearing
+#include "..\script_component.hpp"
diff --git a/addons/compat_ef/config.cpp b/addons/compat_ef/config.cpp
index 9f701b7083f..0a8eea8c41c 100644
--- a/addons/compat_ef/config.cpp
+++ b/addons/compat_ef/config.cpp
@@ -1,5 +1,4 @@
#include "script_component.hpp"
-#include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp"
class CfgPatches {
class ADDON {
diff --git a/addons/compat_spe/CfgWeapons.hpp b/addons/compat_spe/CfgWeapons.hpp
index f6b1532bdad..35d04a36dcd 100644
--- a/addons/compat_spe/CfgWeapons.hpp
+++ b/addons/compat_spe/CfgWeapons.hpp
@@ -1,5 +1,4 @@
class CfgWeapons {
- #include "CfgWeapons\helmets.hpp"
#include "CfgWeapons\launchers.hpp"
#include "CfgWeapons\weapons.hpp"
};
diff --git a/addons/compat_spe/CfgWeapons/helmets.hpp b/addons/compat_spe/CfgWeapons/helmets.hpp
deleted file mode 100644
index 54cbfd15b86..00000000000
--- a/addons/compat_spe/CfgWeapons/helmets.hpp
+++ /dev/null
@@ -1,142 +0,0 @@
-class H_SPE_HelmetB;
-class H_SPE_Hat: H_SPE_HelmetB {};
-
-//ALLIED PILOT
-class H_SPE_US_Helmet_Pilot: H_SPE_Hat {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_Pilot_Op: H_SPE_US_Helmet_Pilot {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_Pilot_Glasses_Up: H_SPE_US_Helmet_Pilot {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_Pilot_Glasses_Down: H_SPE_US_Helmet_Pilot {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_Pilot_Respirator: H_SPE_US_Helmet_Pilot {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_Pilot_Respirator_Glasses_Up: H_SPE_US_Helmet_Pilot_Respirator {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_Pilot_Respirator_Glasses_Down: H_SPE_US_Helmet_Pilot_Respirator {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_Pilot_SWDG_Respirator: H_SPE_US_Helmet_Pilot {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_Pilot_SWDG_low_Respirator: H_SPE_US_Helmet_Pilot {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_H15: H_SPE_US_Helmet_Pilot {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_H15_Op: H_SPE_US_Helmet_H15 {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_H15_SWDG: H_SPE_US_Helmet_H15 {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_H15_SWDG_low: H_SPE_US_Helmet_H15 {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_H15_O2: H_SPE_US_Helmet_H15 {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_H15_B7_O2: H_SPE_US_Helmet_H15_O2 {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_H15_B7_low_O2: H_SPE_US_Helmet_H15_O2 {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_H15_SWDG_O2: H_SPE_US_Helmet_H15_O2 {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_H15_SWDG_low_O2: H_SPE_US_Helmet_H15_O2 {
- HEARING_PROTECTION_EARMUFF;
-};
-
-//ALLIED TANKER
-class H_SPE_US_Helmet_Tank: H_SPE_HelmetB {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_Tank_NG: H_SPE_US_Helmet_Tank {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_Tank_Nun: H_SPE_US_Helmet_Tank {
- HEARING_PROTECTION_OPEN;
-};
-class H_SPE_US_Helmet_Tank_M1_OS: H_SPE_US_Helmet_Tank {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_Tank_M1_NS: H_SPE_US_Helmet_Tank_M1_OS {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_Tank_M1_Scrim: H_SPE_US_Helmet_Tank_M1_OS {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_Tank_polar: H_SPE_US_Helmet_Tank {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_Tank_polar_tapes: H_SPE_US_Helmet_Tank_polar {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_Tank_polar_low: H_SPE_US_Helmet_Tank_polar {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_US_Helmet_Tank_tapes: H_SPE_US_Helmet_Tank {
- HEARING_PROTECTION_EARMUFF;
-};
-
-//AXIS PILOT
-class H_SPE_GER_LW_PilotHelmet_base: H_SPE_Hat {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_GER_LW_PilotHelmet: H_SPE_GER_LW_PilotHelmet_base {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_GER_LW_S_PilotHelmet: H_SPE_GER_LW_PilotHelmet_base {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_GER_LW_PilotHelmet_Mask_base: H_SPE_Hat {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_GER_LW_PilotHelmet_Mask: H_SPE_GER_LW_PilotHelmet_Mask_base {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_GER_LW_PilotHelmet_S_Mask: H_SPE_GER_LW_PilotHelmet_Mask_base {
- HEARING_PROTECTION_EARMUFF;
-};
-
-//AXIS TANKER
-class H_SPE_GER_TankPrivateCap: H_SPE_Hat {
- HEARING_PROTECTION_OPEN;
-};
-class H_SPE_GER_TankOfficerCap: H_SPE_Hat {
- HEARING_PROTECTION_OPEN;
-};
-class H_SPE_GER_Fieldcap: H_SPE_Hat {
- HEARING_PROTECTION_OPEN;
-};
-class H_SPE_GER_Fieldcap2: H_SPE_GER_Fieldcap {
- HEARING_PROTECTION_OPEN;
-};
-class H_SPE_GER_TankPrivateCap2: H_SPE_GER_TankPrivateCap {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_GER_TankOffzCap2: H_SPE_GER_TankPrivateCap {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_GER_TankOfficerCap2: H_SPE_GER_TankOfficerCap {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_GER_SPGPrivateCap: H_SPE_Hat {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_GER_ST_Tanker_Cap2: H_SPE_GER_Fieldcap2 {
- HEARING_PROTECTION_EARMUFF;
-};
-class H_SPE_GER_ST_Tanker_Cap: H_SPE_GER_Fieldcap {
- HEARING_PROTECTION_EARMUFF;
-};
diff --git a/addons/compat_spe/compat_spe_hearing/CfgWeapons.hpp b/addons/compat_spe/compat_spe_hearing/CfgWeapons.hpp
new file mode 100644
index 00000000000..a1e1fcc3b99
--- /dev/null
+++ b/addons/compat_spe/compat_spe_hearing/CfgWeapons.hpp
@@ -0,0 +1,145 @@
+class CfgWeapons {
+ class H_SPE_HelmetB;
+ class H_SPE_Hat: H_SPE_HelmetB {};
+
+ //ALLIED PILOT
+ class H_SPE_US_Helmet_Pilot: H_SPE_Hat {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_Pilot_Op: H_SPE_US_Helmet_Pilot {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_Pilot_Glasses_Up: H_SPE_US_Helmet_Pilot {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_Pilot_Glasses_Down: H_SPE_US_Helmet_Pilot {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_Pilot_Respirator: H_SPE_US_Helmet_Pilot {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_Pilot_Respirator_Glasses_Up: H_SPE_US_Helmet_Pilot_Respirator {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_Pilot_Respirator_Glasses_Down: H_SPE_US_Helmet_Pilot_Respirator {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_Pilot_SWDG_Respirator: H_SPE_US_Helmet_Pilot {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_Pilot_SWDG_low_Respirator: H_SPE_US_Helmet_Pilot {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_H15: H_SPE_US_Helmet_Pilot {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_H15_Op: H_SPE_US_Helmet_H15 {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_H15_SWDG: H_SPE_US_Helmet_H15 {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_H15_SWDG_low: H_SPE_US_Helmet_H15 {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_H15_O2: H_SPE_US_Helmet_H15 {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_H15_B7_O2: H_SPE_US_Helmet_H15_O2 {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_H15_B7_low_O2: H_SPE_US_Helmet_H15_O2 {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_H15_SWDG_O2: H_SPE_US_Helmet_H15_O2 {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_H15_SWDG_low_O2: H_SPE_US_Helmet_H15_O2 {
+ HEARING_PROTECTION_EARMUFF;
+ };
+
+ //ALLIED TANKER
+ class H_SPE_US_Helmet_Tank: H_SPE_HelmetB {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_Tank_NG: H_SPE_US_Helmet_Tank {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_Tank_Nun: H_SPE_US_Helmet_Tank {
+ HEARING_PROTECTION_OPEN;
+ };
+ class H_SPE_US_Helmet_Tank_M1_OS: H_SPE_US_Helmet_Tank {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_Tank_M1_NS: H_SPE_US_Helmet_Tank_M1_OS {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_Tank_M1_Scrim: H_SPE_US_Helmet_Tank_M1_OS {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_Tank_polar: H_SPE_US_Helmet_Tank {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_Tank_polar_tapes: H_SPE_US_Helmet_Tank_polar {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_Tank_polar_low: H_SPE_US_Helmet_Tank_polar {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_US_Helmet_Tank_tapes: H_SPE_US_Helmet_Tank {
+ HEARING_PROTECTION_EARMUFF;
+ };
+
+ //AXIS PILOT
+ class H_SPE_GER_LW_PilotHelmet_base: H_SPE_Hat {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_GER_LW_PilotHelmet: H_SPE_GER_LW_PilotHelmet_base {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_GER_LW_S_PilotHelmet: H_SPE_GER_LW_PilotHelmet_base {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_GER_LW_PilotHelmet_Mask_base: H_SPE_Hat {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_GER_LW_PilotHelmet_Mask: H_SPE_GER_LW_PilotHelmet_Mask_base {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_GER_LW_PilotHelmet_S_Mask: H_SPE_GER_LW_PilotHelmet_Mask_base {
+ HEARING_PROTECTION_EARMUFF;
+ };
+
+ //AXIS TANKER
+ class H_SPE_GER_TankPrivateCap: H_SPE_Hat {
+ HEARING_PROTECTION_OPEN;
+ };
+ class H_SPE_GER_TankOfficerCap: H_SPE_Hat {
+ HEARING_PROTECTION_OPEN;
+ };
+ class H_SPE_GER_Fieldcap: H_SPE_Hat {
+ HEARING_PROTECTION_OPEN;
+ };
+ class H_SPE_GER_Fieldcap2: H_SPE_GER_Fieldcap {
+ HEARING_PROTECTION_OPEN;
+ };
+ class H_SPE_GER_TankPrivateCap2: H_SPE_GER_TankPrivateCap {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_GER_TankOffzCap2: H_SPE_GER_TankPrivateCap {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_GER_TankOfficerCap2: H_SPE_GER_TankOfficerCap {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_GER_SPGPrivateCap: H_SPE_Hat {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_GER_ST_Tanker_Cap2: H_SPE_GER_Fieldcap2 {
+ HEARING_PROTECTION_EARMUFF;
+ };
+ class H_SPE_GER_ST_Tanker_Cap: H_SPE_GER_Fieldcap {
+ HEARING_PROTECTION_EARMUFF;
+ };
+
+};
diff --git a/addons/compat_spe/compat_spe_hearing/config.cpp b/addons/compat_spe/compat_spe_hearing/config.cpp
new file mode 100644
index 00000000000..b2b55e9ff42
--- /dev/null
+++ b/addons/compat_spe/compat_spe_hearing/config.cpp
@@ -0,0 +1,27 @@
+#include "script_component.hpp"
+#include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp"
+
+class CfgPatches {
+ class SUBADDON {
+ name = COMPONENT_NAME;
+ units[] = {};
+ weapons[] = {};
+ requiredVersion = REQUIRED_VERSION;
+ requiredAddons[] = {
+ "ww2_spe_assets_c_weapons_infantryweapons_c",
+ "ww2_spe_assets_c_vehicles_staticweapons_c",
+ "ww2_spe_assets_c_vehicles_weapons_c",
+ "ww2_spe_core_f_system_staticweapons_f",
+ "ww2_spe_core_c_core_c_eventhandlers",
+ "ace_hearing"
+ };
+ skipWhenMissingDependencies = 1;
+ author = ECSTRING(common,ACETeam);
+ url = ECSTRING(main,URL);
+ VERSION_CONFIG;
+
+ addonRootClass = QUOTE(ADDON);
+ };
+};
+
+#include "CfgWeapons.hpp"
diff --git a/addons/compat_spe/compat_spe_hearing/script_component.hpp b/addons/compat_spe/compat_spe_hearing/script_component.hpp
new file mode 100644
index 00000000000..8edb825af34
--- /dev/null
+++ b/addons/compat_spe/compat_spe_hearing/script_component.hpp
@@ -0,0 +1,3 @@
+#define SUBCOMPONENT hearing
+#define SUBCOMPONENT_BEAUTIFIED Hearing
+#include "..\script_component.hpp"
diff --git a/addons/compat_spe/config.cpp b/addons/compat_spe/config.cpp
index 5c1ba718d68..13bd24f53dd 100644
--- a/addons/compat_spe/config.cpp
+++ b/addons/compat_spe/config.cpp
@@ -1,5 +1,4 @@
#include "script_component.hpp"
-#include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp"
class CfgPatches {
class ADDON {
diff --git a/addons/medical_treatment/functions/fnc_createLitterServer.sqf b/addons/medical_treatment/functions/fnc_createLitterServer.sqf
index afeba0eb36b..b19ddc9baa5 100644
--- a/addons/medical_treatment/functions/fnc_createLitterServer.sqf
+++ b/addons/medical_treatment/functions/fnc_createLitterServer.sqf
@@ -24,15 +24,22 @@ if (isNil QGVAR(litterObjects)) then {
GVAR(litterCleanup) = false;
};
-private _model = getText (configFile >> "CfgVehicles" >> _litterClass >> "model");
-if (_model == "") exitWith {};
+private _config = configFile >> "CfgVehicles" >> _litterClass;
+private _modelOrClass = if (getNumber (_config >> QGVAR(useClass)) == 1) then {
+ _litterClass
+} else {
+ getText (_config >> "model");
+};
+
+
+if (_modelOrClass == "") exitWith {};
// createSimpleObject expects a path without the leading slash
-if (_model select [0, 1] == "\") then {
- _model = _model select [1];
+if (_modelOrClass select [0, 1] == "\") then {
+ _modelOrClass = _modelOrClass select [1];
};
-private _object = createSimpleObject [_model, [0, 0, 0]];
+private _object = createSimpleObject [_modelOrClass, [0, 0, 0]];
_object setPosASL _position;
_object setDir _direction;
diff --git a/addons/medical_treatment/initSettings.inc.sqf b/addons/medical_treatment/initSettings.inc.sqf
index b5297e7f34b..11166f8002e 100644
--- a/addons/medical_treatment/initSettings.inc.sqf
+++ b/addons/medical_treatment/initSettings.inc.sqf
@@ -3,7 +3,7 @@
"LIST",
[LSTRING(AdvancedDiagnose_DisplayName), LSTRING(AdvancedDiagnose_Description)],
LSTRING(Category),
- [[0, 1, 2, 3], [ELSTRING(common,Disabled), ELSTRING(common,Enabled), LSTRING(AdvancedDiagnose_DiagnoseCardiacArrest), LSTRING(AdvancedDiagnose_DiagnoseCardiacArrestDirect)], 1],
+ [[0, 1, 2, 3], [ELSTRING(common,Disabled), ELSTRING(common,Enabled), LSTRING(AdvancedDiagnose_DiagnoseCardiacArrest), LSTRING(AdvancedDiagnose_DiagnoseCardiacArrestDirect)], 2],
true
] call CBA_fnc_addSetting;
diff --git a/addons/sitting/XEH_clientInit.sqf b/addons/sitting/XEH_clientInit.sqf
index bb2b1e2e681..4b3ea3fbadf 100644
--- a/addons/sitting/XEH_clientInit.sqf
+++ b/addons/sitting/XEH_clientInit.sqf
@@ -9,13 +9,10 @@ if (!hasInterface) exitWith {};
// If not enabled, then do not add CanInteractWith Condition or event handlers
if (!XGVAR(enable)) exitWith {};
- // Initialize classes as they spawn
- ["ThingX", "init", LINKFUNC(addSitActions), nil, nil, true] call CBA_fnc_addClassEventHandler;
-
- // Initialize statically defined benches (also appear as world objects, no class EH thrown)
+ // Initialize all seats
{
- [_x] call FUNC(addSitActions);
- } forEach [BENCHES];
+ _x call FUNC(addSitActions);
+ } forEach keys (uiNamespace getVariable [QGVAR(seats), []]);
// Add interaction menu exception
["isNotSitting", {isNil {(_this select 0) getVariable QGVAR(sittingStatus)}}] call EFUNC(common,addCanInteractWithCondition);
diff --git a/addons/sitting/XEH_preStart.sqf b/addons/sitting/XEH_preStart.sqf
index 022888575ed..0cc72dc4912 100644
--- a/addons/sitting/XEH_preStart.sqf
+++ b/addons/sitting/XEH_preStart.sqf
@@ -1,3 +1,8 @@
#include "script_component.hpp"
#include "XEH_PREP.hpp"
+
+private _seats = QUOTE(getNumber (_x >> QQXGVAR(canSit)) == 1) configClasses (configFile >> "CfgVehicles");
+_seats = _seats apply {configName _x};
+
+uiNamespace setVariable [QGVAR(seats), compileFinal (_seats createHashMapFromArray [])];
diff --git a/addons/sitting/functions/fnc_addSitActions.sqf b/addons/sitting/functions/fnc_addSitActions.sqf
index a705ca21e69..d9264af1027 100644
--- a/addons/sitting/functions/fnc_addSitActions.sqf
+++ b/addons/sitting/functions/fnc_addSitActions.sqf
@@ -15,6 +15,11 @@
* Public: No
*/
+// Only run this after the settings are initialized
+if !(EGVAR(common,settingsInitFinished)) exitWith {
+ EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(addSitActions), _this];
+};
+
params ["_seat"];
private _type = _seat;
@@ -69,3 +74,4 @@ if !((_sitPosition select 0) isEqualType []) then {
[_type, 0, _menuType, _sitAction] call EFUNC(interact_menu,addActionToClass);
} forEach _sitPosition;
+nil // return
diff --git a/addons/sitting/functions/fnc_canSit.sqf b/addons/sitting/functions/fnc_canSit.sqf
index 609bcea6828..5c8ea3be549 100644
--- a/addons/sitting/functions/fnc_canSit.sqf
+++ b/addons/sitting/functions/fnc_canSit.sqf
@@ -21,10 +21,13 @@ params ["_seat", "_player", ["_seatPos", 0]];
// Sitting enabled, not occupied and standing up (or not on a big slope)
XGVAR(enable) &&
-{[_player, _seat] call EFUNC(common,canInteractWith)} &&
{isNil {_player getVariable QGVAR(sittingStatus)}} &&
-{
+{round (vectorUp _seat select 0) == 0 && {round (vectorUp _seat select 1) == 0} && {round (vectorUp _seat select 2) == 1}} && {
private _seatsClaimed = _seat getVariable [QGVAR(seatsClaimed), []];
- _seatsClaimed isEqualTo [] || {!(_seatsClaimed select _seatPos)}
-} &&
-{round (vectorUp _seat select 0) == 0 && {round (vectorUp _seat select 1) == 0} && {round (vectorUp _seat select 2) == 1}}
+
+ (_seatsClaimed isEqualTo [] || {isNull (_seatsClaimed select _seatPos)}) && {
+ ([_player, _seat] call EFUNC(common,canInteractWith)) || // not claimed (common case)
+ // Can self-interact and chair claimed by another sitter
+ {([_player, objNull] call EFUNC(common,canInteractWith)) && {(_seatsClaimed findIf {!isNull _x}) != -1}}
+ }
+}
diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf
index d359083c44a..29da603c64f 100644
--- a/addons/sitting/functions/fnc_sit.sqf
+++ b/addons/sitting/functions/fnc_sit.sqf
@@ -1,7 +1,7 @@
#include "..\script_component.hpp"
/*
* Author: Jonpas, vabene1111
- * Sits down the player.
+ * Makes the player sit down.
*
* Arguments:
* 0: Seat