From 86476c1d804006635ac4c13f7605a787cf2dceeb Mon Sep 17 00:00:00 2001 From: Bubbus Date: Tue, 7 Mar 2023 20:04:57 +0000 Subject: [PATCH] Made gravestone manager respect setting of GRAVESTONES_USE_PRIORITY_LIST config value. --- .../gravestones/fn_addToGravestoneManager.sqf | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/components/gravestones/fn_addToGravestoneManager.sqf b/components/gravestones/fn_addToGravestoneManager.sqf index db7a432f..1895f2c7 100644 --- a/components/gravestones/fn_addToGravestoneManager.sqf +++ b/components/gravestones/fn_addToGravestoneManager.sqf @@ -12,7 +12,7 @@ if (isNull _unit) exitWith DEBUG_PRINT_LOG("[Gravestones] Called addToGravestoneManager but the corpse was a null object.") }; -_shouldCache = _unit getVariable ["f_var_allowGravestone", true] and {(group _unit) getVariable ["f_var_allowGravestone", true]}; +_shouldCache = (_unit getVariable ["f_var_allowGravestone", true]) and {(group _unit) getVariable ["f_var_allowGravestone", true]}; if !(_shouldCache) exitWith { @@ -32,13 +32,17 @@ _netId = _unit call BIS_fnc_netId; _cacheEntry = [time, _netId, _name, _obituary]; -if (isPlayer _unit) exitWith -{ - DEBUG_FORMAT1_LOG("[Gravestones] Adding corpse to the priority cache because it was a player: %1",_unit) +#ifdef GRAVESTONES_USE_PRIORITY_LIST - _cacheEntry pushBack true; - [_cacheEntry, "VIP_CACHE"] call f_fnc_sendUnitToGravestoneCache; -}; + if (isPlayer _unit) exitWith + { + DEBUG_FORMAT1_LOG("[Gravestones] Adding corpse to the priority cache because it was a player: %1",_unit) + + _cacheEntry pushBack true; + [_cacheEntry, "VIP_CACHE"] call f_fnc_sendUnitToGravestoneCache; + }; + +#endif _cacheEntry pushBack false; [_cacheEntry, "CACHE"] call f_fnc_sendUnitToGravestoneCache;