Headless - Add warning about duplicate loadout validation (#9878)

* Warn users about duplicate loadout validation

* Update XEH_postInit.sqf
This commit is contained in:
johnb432 2024-06-14 20:02:13 +02:00 committed by GitHub
parent 34362d48eb
commit 7a6c837f1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,7 @@
#include "script_component.hpp" #include "script_component.hpp"
if (!isMultiplayer) exitWith {};
["CBA_settingsInitialized", { ["CBA_settingsInitialized", {
// Register and remove HCs if not client that is not server and distribution or end mission enabled // Register and remove HCs if not client that is not server and distribution or end mission enabled
if ((!hasInterface || isServer) && {XGVAR(enabled) || XGVAR(endMission) != 0}) then { if ((!hasInterface || isServer) && {XGVAR(enabled) || XGVAR(endMission) != 0}) then {
@ -25,6 +27,23 @@
(_rebalance == FORCED_REBALANCE) call FUNC(rebalance); (_rebalance == FORCED_REBALANCE) call FUNC(rebalance);
}; };
}] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler;
// If CBA's loadout validation is enabled, warn users
if (XGVAR(transferLoadout) > 0 && {(missionNamespace getVariable ["CBA_network_loadoutValidation", 0]) isEqualTo 2}) then {
WARNING("CBA_network_loadoutValidation is enabled - acex_headless_transferLoadout should therefore be disabled");
[QEGVAR(common,displayTextStructured), ["CBA_network_loadoutValidation is enabled - acex_headless_transferLoadout should therefore be disabled", 3]] call CBA_fnc_globalEvent;
};
["CBA_SettingChanged", {
params ["_setting", "_value"];
if (_setting != "CBA_network_loadoutValidation") exitWith {};
if (XGVAR(transferLoadout) > 0 && {_value isEqualTo 2}) then {
WARNING("CBA_network_loadoutValidation is enabled - acex_headless_transferLoadout should therefore be disabled");
[QEGVAR(common,displayTextStructured), ["CBA_network_loadoutValidation is enabled - acex_headless_transferLoadout should therefore be disabled", 3]] call CBA_fnc_globalEvent;
};
}] call CBA_fnc_addEventHandler;
} else { } else {
// Register HC (this part happens on HC only) // Register HC (this part happens on HC only)
[QXGVAR(headlessClientJoined), [player]] call CBA_fnc_globalEvent; // Global event for API purposes [QXGVAR(headlessClientJoined), [player]] call CBA_fnc_globalEvent; // Global event for API purposes