Skip to content

Commit

Permalink
Merge pull request #459 from CBATeam/fix-settings-import-only-temporary
Browse files Browse the repository at this point in the history
fix auto-load and static-settings not working
  • Loading branch information
Killswitch00 committed Aug 17, 2016
2 parents ca02909 + 407e225 commit 4d892b8
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 4d892b8

Please sign in to comment.