Skip to content

Commit

Permalink
Medical - Clean up namespaces used by (de-)serializing functions (#8514)
Browse files Browse the repository at this point in the history
  • Loading branch information
mharis001 authored Oct 14, 2021
1 parent 0c85f5f commit 0fe54b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions addons/medical/functions/fnc_deserializeState.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,5 @@ private _targetState = _state getVariable [QGVAR(statemachineState), "Default"];
if (_currentState in ["Unconscious", "CardiacArrest"] && {_targetState in ["Default", "Injured"]}) then {
[_unit, false] call EFUNC(medical_status,setUnconsciousState);
};

_state call CBA_fnc_deleteNamespace;
4 changes: 3 additions & 1 deletion addons/medical/functions/fnc_serializeState.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,6 @@ private _currentState = [_unit, GVAR(STATE_MACHINE)] call CBA_statemachine_fnc_g
_state setVariable [QGVAR(statemachineState), _currentState];

// Serialize & return
[_state] call CBA_fnc_encodeJSON
private _json = [_state] call CBA_fnc_encodeJSON;
_state call CBA_fnc_deleteNamespace;
_json

0 comments on commit 0fe54b8

Please sign in to comment.