mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Interaction - Allow unloading patients, bodies, and captives from inside vehicles (#9645)
* add unloading from inside vehicles * Update addons/common/functions/fnc_findUnloadPosition.sqf * Update fnc_findUnloadPosition.sqf
This commit is contained in:
parent
bae63636b7
commit
6741822480
@ -1,6 +1,6 @@
|
|||||||
#include "..\script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: commy2
|
* Author: commy2, LinkIsGrim
|
||||||
* Check if the unit can unload a captive from the vehicle.
|
* Check if the unit can unload a captive from the vehicle.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
@ -19,4 +19,6 @@
|
|||||||
params ["_player", "_unit"];
|
params ["_player", "_unit"];
|
||||||
|
|
||||||
// Don't show "Unload Captive" if unit is unconscious (already has "Unload Patient")
|
// Don't show "Unload Captive" if unit is unconscious (already has "Unload Patient")
|
||||||
(vehicle _unit != _unit) && {vehicle _player == _player} && {_unit getVariable [QGVAR(isHandcuffed), false]} && {!(_unit getVariable ["ACE_isUnconscious", false])}
|
!isNull objectParent _unit &&
|
||||||
|
{_unit getVariable [QGVAR(isHandcuffed), false]} &&
|
||||||
|
{lifeState _unit in ["HEALTHY", "INJURED"]}
|
||||||
|
@ -54,7 +54,7 @@ if (_item isKindOf "CAManBase") then {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isNull _unloader) then {
|
if (isNull _unloader || {_unloader in _vehicle}) then {
|
||||||
_unloader = _vehicle;
|
_unloader = _vehicle;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
class ACE_UnloadPatient {
|
class ACE_UnloadPatient {
|
||||||
displayName = CSTRING(UnloadPatient);
|
displayName = CSTRING(UnloadPatient);
|
||||||
condition = QUOTE((_target getVariable [ARR_2('ACE_isUnconscious',false)] || {!alive _target}) && {!isNull objectParent _target} && {isNull objectParent _player});
|
condition = QUOTE([ARR_2(_player,_target)] call EFUNC(medical_treatment,canUnloadUnit));
|
||||||
exceptions[] = {"isNotDragging", "isNotCarrying", "isNotInside"};
|
exceptions[] = {"isNotDragging", "isNotCarrying", "isNotInside"};
|
||||||
statement = QUOTE([ARR_2(_player,_target)] call EFUNC(medical_treatment,unloadUnit));
|
statement = QUOTE([ARR_2(_player,_target)] call EFUNC(medical_treatment,unloadUnit));
|
||||||
icon = QPATHTOF(ui\cross.paa);
|
icon = QPATHTOF(ui\cross.paa);
|
||||||
|
@ -13,6 +13,7 @@ PREP(canStitch);
|
|||||||
PREP(canTreat);
|
PREP(canTreat);
|
||||||
PREP(canTreatCached);
|
PREP(canTreatCached);
|
||||||
PREP(canTreat_holsterCheck);
|
PREP(canTreat_holsterCheck);
|
||||||
|
PREP(canUnloadUnit);
|
||||||
PREP(checkBloodPressure);
|
PREP(checkBloodPressure);
|
||||||
PREP(checkBloodPressureLocal);
|
PREP(checkBloodPressureLocal);
|
||||||
PREP(checkPulse);
|
PREP(checkPulse);
|
||||||
|
22
addons/medical_treatment/functions/fnc_canUnloadUnit.sqf
Normal file
22
addons/medical_treatment/functions/fnc_canUnloadUnit.sqf
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
/*
|
||||||
|
* Author: LinkIsGrim
|
||||||
|
* Checks if unit can be unloaded.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Unloader <OBJECT>
|
||||||
|
* 1: Target <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Can Unload <BOOL>
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [player, bob] call ace_medical_treatment_fnc_canUnloadUnit
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
|
||||||
|
params ["_unloader", "_target"];
|
||||||
|
|
||||||
|
!isNull objectParent _target &&
|
||||||
|
{!(lifeState _target in ["HEALTHY", "INJURED"])}
|
Loading…
Reference in New Issue
Block a user