Added hasMedicalEnabled

This commit is contained in:
Glowbal 2015-02-22 00:49:38 +01:00
parent e21046459e
commit e091ba1fd1
3 changed files with 24 additions and 2 deletions

View File

@ -44,6 +44,7 @@ PREP(onTreatmentCompleted);
PREP(reactionToDamage);
PREP(useItem);
PREP(hasItem);
PREP(hasMedicalEnabled);
PREP(hasTourniquetAppliedTo);
PREP(isMedic);
PREP(isInMedicalFacility);

View File

@ -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];

View 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;