mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Added hasMedicalEnabled
This commit is contained in:
parent
e21046459e
commit
e091ba1fd1
@ -44,6 +44,7 @@ PREP(onTreatmentCompleted);
|
||||
PREP(reactionToDamage);
|
||||
PREP(useItem);
|
||||
PREP(hasItem);
|
||||
PREP(hasMedicalEnabled);
|
||||
PREP(hasTourniquetAppliedTo);
|
||||
PREP(isMedic);
|
||||
PREP(isInMedicalFacility);
|
||||
|
@ -24,10 +24,10 @@ _damage = _this select 2;
|
||||
_shooter = _this select 3;
|
||||
_projectile = _this select 4;
|
||||
|
||||
diag_log _this;
|
||||
|
||||
if !(local _unit) exitWith {nil};
|
||||
|
||||
if !([_unit] call FUNC(hasMedicalEnabled)) exitwith {};
|
||||
|
||||
if (typeName _projectile == "OBJECT") then {
|
||||
_projectile = typeOf _projectile;
|
||||
_this set [4, _projectile];
|
||||
|
21
addons/medical/functions/fnc_hasMedicalEnabled.sqf
Normal file
21
addons/medical/functions/fnc_hasMedicalEnabled.sqf
Normal file
@ -0,0 +1,21 @@
|
||||
/**
|
||||
* fn_hasMedicalEnabled.sqf
|
||||
* @Descr: Check if unit has CMS enabled.
|
||||
* @Author: Glowbal
|
||||
*
|
||||
* @Arguments: [unit OBJECT]
|
||||
* @Return: BOOL
|
||||
* @PublicAPI: true
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_medicalEnabled"];
|
||||
_unit = _this select 0;
|
||||
|
||||
_medicalEnabled = _unit getvariable QGVAR(enableMedical);
|
||||
if (isnil "_medicalEnabled") exitwith {
|
||||
(((GVAR(setting_enableForUnits) == 0 && (isPlayer _unit || (_unit getvariable [QEGVAR(common,isDeadPlayer), false])))) || (GVAR(setting_enableForUnits) == 1));
|
||||
};
|
||||
|
||||
_medicalEnabled;
|
Loading…
Reference in New Issue
Block a user