Skip to content

Commit

Permalink
fix hashmap key
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkIsGrim authored Jan 5, 2025
1 parent a4c0ffd commit 4e57482
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion addons/medical_vitals/functions/fnc_consumeIVs.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private _consumedIVs = [];
};
} forEachReversed _ivBags;

(GVAR(deferredEvents) getOrDefault [_unit, [], true]) pushBack ([QEGVAR(medical,consumedIVs), [_unit, _consumedIVs]]);
(GVAR(deferredEvents) getOrDefault [hashValue _unit, [], true]) pushBack ([QEGVAR(medical,consumedIVs), [_unit, _consumedIVs]]);

if (_ivBags isEqualTo []) then {
_unit setVariable [QEGVAR(medical,ivBags), nil, true];
Expand Down
2 changes: 1 addition & 1 deletion addons/medical_vitals/functions/fnc_consumeMedications.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private _consumedMedications = [];
};
} forEachReversed _medications;

(GVAR(deferredEvents) getOrDefault [_unit, [], true]) pushBack ([QEGVAR(medical,consumeMedications), [_unit, _consumedMedications]]);
(GVAR(deferredEvents) getOrDefault [hashValue _unit, [], true]) pushBack ([QEGVAR(medical,consumeMedications), [_unit, _consumedMedications]]);

if (_syncValues) then {
_unit setVariable [VAR_MEDICATIONS, _medications, true]
Expand Down
4 changes: 2 additions & 2 deletions addons/medical_vitals/functions/fnc_handleUnitVitals.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ END_COUNTER(Vitals);
//placed outside the counter as 3rd-party code may be called from these events
{
_x call CBA_fnc_localEvent;
} forEach (GVAR(deferredEvents) getOrDefault [_unit, []]);
} forEach (GVAR(deferredEvents) getOrDefault [hashValue _unit, []]);

GVAR(deferredEvents) deleteAt _unit;
GVAR(deferredEvents) deleteAt hashValue _unit;

[QEGVAR(medical,handleUnitVitals), [_unit, _deltaT]] call CBA_fnc_localEvent;

Expand Down

0 comments on commit 4e57482

Please sign in to comment.