diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index 26fa87e706..1d87803f43 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -60,8 +60,9 @@ class ACE_Settings { value = 0; }; class GVAR(enableRevive) { - typeName = "BOOL"; + typeName = "SCALAR"; value = 0; + values[] = {"Disabled", "Players only", "Players and AI"}; }; class GVAR(maxReviveTime) { typeName = "SCALAR"; diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 339abe5a42..f28322baf7 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -238,8 +238,13 @@ class CfgVehicles { class enableRevive { displayName = "Enable Revive"; description = "Enable a basic revive system"; - typeName = "BOOL"; + typeName = "NUMBER"; defaultValue = 0; + class values { + class disable { name = "Disabled"; value = 0; default = 1;}; + class playerOnly { name = "Player only"; value = 1; }; + class playerAndAI { name = "Player & AI"; value = 2; }; + }; }; class maxReviveTime { displayName = "Max Revive time"; diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index a989513580..db799b45ab 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -76,7 +76,7 @@ if (GVAR(level) >= 2) then { }; [_unit] call FUNC(addToInjuredCollection); -if (((_unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)])) && {_damageReturn >= 0.9} && {_selection in ["", "head", "body"]}) exitWith { +if (((_unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]) > 0) && {_damageReturn >= 0.9} && {_selection in ["", "head", "body"]}) exitWith { if (vehicle _unit != _unit and {damage _vehicle >= 1}) then { // @todo // [_unit] call FUNC(unload); diff --git a/addons/medical/functions/fnc_setDead.sqf b/addons/medical/functions/fnc_setDead.sqf index 428d6674ab..9d8498cd04 100644 --- a/addons/medical/functions/fnc_setDead.sqf +++ b/addons/medical/functions/fnc_setDead.sqf @@ -13,7 +13,7 @@ #include "script_component.hpp" -private ["_unit", "_force"]; +private ["_unit", "_force", "_reviveVal"]; _unit = _this select 0; _force = false; if (count _this >= 2) then { @@ -26,7 +26,8 @@ if (!local _unit) exitwith { false; }; -if ((_unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]) && !_force) exitwith { +_reviveVal = _unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]; +if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal == 2)) && !_force) exitwith { if (_unit getvariable [QGVAR(inReviveState), false]) exitwith { if (GVAR(amountOfReviveLives) > 0) then { _lifesLeft = _unit getvariable[QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives)];