diff --git a/addons/dogtags/CfgVehicles.hpp b/addons/dogtags/CfgVehicles.hpp index 8e9204c4ca..9757ac1c53 100644 --- a/addons/dogtags/CfgVehicles.hpp +++ b/addons/dogtags/CfgVehicles.hpp @@ -9,14 +9,14 @@ class CfgVehicles { statement = ""; showDisabled = 0; priority = 3; - icon = ""; //@todo + icon = QPATHTOF(data\dogtag_icon_ca.paa); class ACE_CheckDogtag { displayName = CSTRING(checkDogtag); condition = QUOTE([ARR_2(_player,_target)] call FUNC(canCheckDogtag)); statement = QUOTE([ARR_2(_player,_target)] call FUNC(checkDogtag)); showDisabled = 0; priority = 3; - icon = ""; //@todo + icon = QPATHTOF(data\dogtag_icon_ca.paa); }; class ACE_TakeDogtag { displayName = CSTRING(takeDogtag); @@ -24,7 +24,7 @@ class CfgVehicles { statement = QUOTE([ARR_2(_player,_target)] call FUNC(takeDogtag)); showDisabled = 0; priority = 3; - icon = ""; //@todo + icon = QPATHTOF(data\dogtag_icon_ca.paa); }; }; }; diff --git a/addons/dogtags/XEH_postInit.sqf b/addons/dogtags/XEH_postInit.sqf index 96a6a3180c..729ae7eb04 100644 --- a/addons/dogtags/XEH_postInit.sqf +++ b/addons/dogtags/XEH_postInit.sqf @@ -4,3 +4,42 @@ [QGVAR(sendDogtagData), DFUNC(sendDogtagData)] call CBA_fnc_addEventHandler; [QGVAR(getDogtagItem), DFUNC(getDogtagItem)] call CBA_fnc_addEventHandler; [QGVAR(addDogtagItem), DFUNC(addDogtagItem)] call CBA_fnc_addEventHandler; + + +//Add actions and event handlers only if ace_medical is loaded +// - Adding actions via config would create a dependency +if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then { + if (hasInterface) then { + + private _checkTagAction = [ + "ACE_CheckDogtag", + format ["%1: %2", localize LSTRING(itemName), localize LSTRING(checkDogtag)], + QPATHTOF(data\dogtag_icon_ca.paa), + {[_player,_target] call FUNC(checkDogtag)}, + {!isNil {_target getVariable QGVAR(dogtagData)}} + ] call ace_interact_menu_fnc_createAction; + ["ACE_bodyBagObject", 0, ["ACE_MainActions"], _checkTagAction] call EFUNC(interact_menu,addActionToClass); + + private _takeTagAction = [ + "ACE_TakeDogtag", + format ["%1: %2", localize LSTRING(itemName), localize LSTRING(takeDogtag)], + QPATHTOF(data\dogtag_icon_ca.paa), + {[_player,_target] call FUNC(takeDogtag)}, + {(!isNil {_target getVariable QGVAR(dogtagData)}) && {((_target getVariable [QGVAR(dogtagTaken), objNull]) != _target)}} + ] call ace_interact_menu_fnc_createAction; + ["ACE_bodyBagObject", 0, ["ACE_MainActions"], _takeTagAction] call EFUNC(interact_menu,addActionToClass); + }; + if (isServer) then { + ["ace_placedInBodyBag", { + params ["_target", "_bodyBag"]; + TRACE_2("ace_placedInBodyBag eh",_target,_bodyBag); + + private _dogTagData = [_target] call FUNC(getDogtagData); + _bodyBag setVariable [QGVAR(dogtagData), _dogTagData, true]; + + if ((_target getVariable [QGVAR(dogtagTaken), objNull]) == _target) then { + _bodyBag setVariable [QGVAR(dogtagTaken), _bodyBag, true]; + }; + }] call CBA_fnc_addEventHandler; + }; +}; diff --git a/addons/dogtags/data/dogtag_icon_ca.paa b/addons/dogtags/data/dogtag_icon_ca.paa new file mode 100644 index 0000000000..4799db17ec Binary files /dev/null and b/addons/dogtags/data/dogtag_icon_ca.paa differ diff --git a/addons/medical/functions/fnc_serverRemoveBody.sqf b/addons/medical/functions/fnc_serverRemoveBody.sqf index 42e755f003..f68ffd95cd 100644 --- a/addons/medical/functions/fnc_serverRemoveBody.sqf +++ b/addons/medical/functions/fnc_serverRemoveBody.sqf @@ -27,7 +27,7 @@ if (isNil QGVAR(bodiesToDelete)) then {GVAR(bodiesToDelete) = [];}; GVAR(bodiesToDelete) pushBack _target; // Start up a loop to wait for bodies to be free to delete -if ((count GVAR(bodiesToDelete)) > 0) then { +if ((count GVAR(bodiesToDelete)) == 1) then { [] call FUNC(bodyCleanupLoop); };