Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix import producing different results from export #853

Merged
merged 1 commit into from
Dec 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions addons/settings/fnc_import.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ Author:

params [["_info", "", [""]], ["_source", "client", [""]]];

_info = [_info, true] call FUNC(parse);
_info = [_info, true, _source] call FUNC(parse);

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

_priority = _priority min ([0, 1, 2] param [["client", "mission", "server"] find toLower _source, 0]);
_priority = SANITIZE_PRIORITY(_setting,_priority,_source);

SET_TEMP_NAMESPACE_VALUE(_setting,_value,_source);
SET_TEMP_NAMESPACE_PRIORITY(_setting,_priority,_source);
Expand Down
8 changes: 4 additions & 4 deletions addons/settings/fnc_parse.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private _fnc_parseAny = {
parseSimpleArray format ["[%1]", _string] select 0
};

params [["_info", "", [""]], ["_validate", false, [false]]];
params [["_info", "", [""]], ["_validate", false, [false]], ["_source", "", [""]]];

// remove whitespace at start and end of each line
private _result = [];
Expand Down Expand Up @@ -66,14 +66,14 @@ _result = [];
_result pushBack [_setting, _value, _priority];
} else {
if (isNil {[_setting, "default"] call FUNC(get)}) exitWith {
ERROR_1("Error parsing settings file. Setting %1 does not exist.",_setting);
ERROR_1("Setting %1 does not exist.",_setting);
};

if !([_setting, _value] call FUNC(check)) exitWith {
ERROR_2("Error parsing settings file. Value %1 is invalid for setting %2.",TO_STRING(_value),_setting);
ERROR_2("Value %1 is invalid for setting %2.",TO_STRING(_value),_setting);
};

_priority = SANITIZE_PRIORITY(_setting,_priority,"");
_priority = SANITIZE_PRIORITY(_setting,_priority,_source);
_result pushBack [_setting, _value, _priority];
};
};
Expand Down