ACE3/addons/medical_treatment/functions/fnc_canAccessMedicalEquipment.sqf
Glowbal a8831a0d16 Change split medical in two components
- medical component is responsible for the injuries and common functionality
- medical_treatment component is responsible for offering treatment functionality
2016-06-13 17:00:56 +02:00

30 lines
678 B
Plaintext

/*
* Author: Glowbal
* Check if caller can access targets medical equipment, based upon accessLevel.
*
* Arguments:
* 0: The caller <OBJECT>
* 1: The target <OBJECT>
*
* ReturnValue:
* Can Treat <BOOL>
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_caller", "_target"];
private _accessLevel = _target getVariable [QGVAR(allowSharedEquipmentAccess), -1];
private _return = false;
if (_accessLevel >= 0) then {
if (_accessLevel == 0) exitWith { _return = true; };
if (_accessLevel == 1) exitWith { _return = (side _target == side _caller); };
if (_accessLevel == 2) exitWith { _return = (group _target == group _caller); };
};
_return;