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:
Grim 2023-11-22 19:38:52 -03:00 committed by GitHub
parent bae63636b7
commit 6741822480
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 4 deletions

View File

@ -1,6 +1,6 @@
#include "..\script_component.hpp"
/*
* Author: commy2
* Author: commy2, LinkIsGrim
* Check if the unit can unload a captive from the vehicle.
*
* Arguments:
@ -19,4 +19,6 @@
params ["_player", "_unit"];
// 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"]}

View File

@ -54,7 +54,7 @@ if (_item isKindOf "CAManBase") then {
};
};
if (isNull _unloader) then {
if (isNull _unloader || {_unloader in _vehicle}) then {
_unloader = _vehicle;
};

View File

@ -57,7 +57,7 @@ class CfgVehicles {
};
class ACE_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"};
statement = QUOTE([ARR_2(_player,_target)] call EFUNC(medical_treatment,unloadUnit));
icon = QPATHTOF(ui\cross.paa);

View File

@ -13,6 +13,7 @@ PREP(canStitch);
PREP(canTreat);
PREP(canTreatCached);
PREP(canTreat_holsterCheck);
PREP(canUnloadUnit);
PREP(checkBloodPressure);
PREP(checkBloodPressureLocal);
PREP(checkPulse);

View 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"])}