Skip to content

Commit

Permalink
fix auto-load and static-settings not working
Browse files Browse the repository at this point in the history
  • Loading branch information
commy2 committed Aug 13, 2016
1 parent bdfb3d8 commit 407e225
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
13 changes: 10 additions & 3 deletions optionals/auto_load_settings_file/loadSettingsFile.sqf
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@

if (isFilePatchingEnabled) then {
private _source = ["client", "server"] select (isMultiplayer && isServer);
private _file = loadFile PATH_SETTINGS_FILE;
private _info = loadFile PATH_SETTINGS_FILE;

if (_info != "") then {
_info = _info call EFUNC(settings,parse);

{
_x params ["_setting", "_value", "_force"];

[_setting, _value, _force, _source] call EFUNC(settings,set);
} forEach _info;

if (_file != "") then {
[_file, _source] call EFUNC(settings,import);
diag_log text "[CBA] (settings): Settings file loaded.";
} else {
diag_log text "[CBA] (settings): Settings file not loaded. File empty or does not exist.";
Expand Down
11 changes: 9 additions & 2 deletions template/static_settings_addon/loadSettingsFile.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
if (isClass (configFile >> "CfgPatches" >> "cba_auto_load_settings_file")) exitWith {};

private _source = ["client", "server"] select (isMultiplayer && isServer);
private _file = loadFile PATH_SETTINGS_FILE_PBO;
private _info = loadFile PATH_SETTINGS_FILE_PBO;

_info = _info call EFUNC(settings,parse);

{
_x params ["_setting", "_value", "_force"];

[_setting, _value, _force, _source] call EFUNC(settings,set);
} forEach _info;

[_file, _source] call EFUNC(settings,import);
diag_log text "[CBA] (settings): Settings file loaded from PBO.";

0 comments on commit 407e225

Please sign in to comment.