ACE3/addons/medical_treatment/functions/fnc_canDigGrave.sqf
Drofseh b9580a0349
Medical Treatment - Change isAwake check for grave digging to only apply to CAManBase (#9451)
* Move awake check for bodybag grave

* Apply suggestions from code review

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

---------

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-10-01 13:42:07 -04:00

27 lines
674 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: Ruthberg, commy2, esteldunedain, drofseh
* Checks if a unit can dig a grave at the position of the patient.
*
* Arguments:
* 0: Medic <OBJECT>
* 1: Patient <OBJECT>
*
* Return Value:
* Can dig <BOOL>
*
* Example:
* [player, cursorObject] call ace_medical_treatment_fnc_canDigGrave
*
* Public: No
*/
params ["_medic", "_patient"];
if !(["ace_trenches"] call EFUNC(common,isModLoaded)) exitWith {false};
(GVAR(allowGraveDigging) > 0)
&& {!((_patient isKindOf "CaManBase") && {_patient call EFUNC(common,isAwake)})}
&& {_patient call EFUNC(common,canDig)}
&& {_medic call EFUNC(trenches,hasEntrenchingTool)}