diff --git a/addons/hashes/fnc_serializeNamespace.sqf b/addons/hashes/fnc_serializeNamespace.sqf index 098b42b01..9dffbc6e1 100644 --- a/addons/hashes/fnc_serializeNamespace.sqf +++ b/addons/hashes/fnc_serializeNamespace.sqf @@ -7,6 +7,7 @@ Description: Parameters: _namespace - a namespace + _defaultValue - Default value. Used when key doesn't exist. A key is also removed from the hash if the value is set to this default [Any, defaults to nil] Returns: _hash - a hash @@ -22,9 +23,9 @@ Author: ---------------------------------------------------------------------------- */ SCRIPT(serializeNamespace); -params [["_namespace", locationNull, [locationNull, objNull]]]; +params [["_namespace", locationNull, [locationNull, objNull]], "_defaultValue"]; -private _hash = [] call CBA_fnc_hashCreate; +private _hash = [[], RETNIL(_defaultValue)] call CBA_fnc_hashCreate; { [_hash, _x, _namespace getVariable _x] call CBA_fnc_hashSet;