ACE3/addons/medical_ai/functions/fnc_canRequestMedic.sqf
PabstMirror 05e4f74e73
Medical AI - Adjust healing logic for rewrite (#6902)
* Medical AI - Adjust healing logic for rewrite

- move state machine from config to sqf
- move all healing logic to seperate func
- attempt to handle healing for new system

* prioritize unitReady medics

* move setting to subcategory under medical

* Use faster GET_WOUND_BLEEDING

* Update fnc_healingLogic.sqf

* Update for wound array changes

* Update treatment events changes

* Fractures/splint

* formating / use GET_OPEN_WOUNDS

* Use non-localized medical category
2019-07-03 09:59:28 -05:00

35 lines
914 B
Plaintext

#include "script_component.hpp"
/*
* Author: BaerMitUmlaut
* Checks if there is a medic available in the unit's group.
*
* Arguments:
* None
*
* Return Value:
* Can request medic <BOOL>
*
* Example:
* player call ACE_medical_ai_fnc_canRequestMedic
*
* Public: No
*/
// Note: Although an unconscious unit cannot call for a medic itself,
// we ignore this here. We need to "notice" the medic that he should
// treat other units, or else he won't do anything on his own.
if ([_this] call EFUNC(medical_treatment,isMedic) || {vehicle _this != _this}) exitWith {false};
// Search for a medic, prioritize unitReady
private _medic = objNull;
{
if ([_x] call EFUNC(medical_treatment,isMedic) && {!([_x] call EFUNC(common,isPlayer))} && {
_medic = _x;
(unitReady _medic)
}) exitWith {};
} forEach (units _this);
_this setVariable [QGVAR(assignedMedic), _medic];
!isNull _medic