Medical - Handle wound hashmaps deserialized as CBA_namespaces (#9245)

This commit is contained in:
Tim Beswick 2023-07-09 15:33:51 +01:00 committed by GitHub
parent 45af0cdca0
commit 29b5eb97a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,6 +56,13 @@ private _state = [_json] call CBA_fnc_parseJSON;
_x params ["_var", "_default"];
private _value = _state getVariable _x;
// Handle wound hashmaps deserialized as CBA_namespaces
if (typeName _value == "LOCATION") then {
private _keys = allVariables _value;
private _values = _keys apply {_value getVariable _x};
_value = _keys createHashMapFromArray _values;
};
// Treat null as nil
if (_value isEqualTo objNull) then {
_value = _default;