Skip to content

Commit

Permalink
Get volatile state at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror committed Oct 17, 2023
1 parent faabb51 commit 1230453
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
6 changes: 0 additions & 6 deletions addons/settings/fnc_initDisplayMain.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ if (_file != "") then {

uiNamespace setVariable [QGVAR(userconfig), compileFinal str _userconfig];

private _volatile = (getNumber (configFile >> QGVAR(volatile)) == 1) && {!hasInterface};
uiNamespace setVariable [QGVAR(volatile), _volatile];
if (_volatile) then {
WARNING("Server settings changes will be lost upon game restart.");
};

private _ctrlAddonOptions = _display displayCtrl IDC_MAIN_ADDONOPTIONS;

if (isNil QUOTE(ADDON)) then {
Expand Down
3 changes: 2 additions & 1 deletion addons/settings/initSettings.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// inline function, don't include script_component.hpp

if (isNil QGVAR(default)) then {
private _volatile = uiNamespace getVariable QGVAR(volatile);
private _volatile = isServer && {!hasInterface} && {(getNumber (configFile >> QGVAR(volatile))) == 1};

GVAR(allSettings) = [];
GVAR(default) = [] call CBA_fnc_createNamespace;
Expand All @@ -13,6 +13,7 @@ if (isNil QGVAR(default)) then {
if (isNil QGVAR(server)) then {
GVAR(server) = NAMESPACE_NULL;
GVAR(serverHashNamespace) = [profileNamespace, uiNamespace] select _volatile;
if (_volatile) then { WARNING("Server settings changes will be lost upon game restart."); };
};

if (isServer) then {
Expand Down

0 comments on commit 1230453

Please sign in to comment.