mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Captives - Allow disarming and blindfolding captives in vehicles (#9463)
* Can disarm captives in vehicles * Can blindfold captives in vehicles * Fix dropping goggles/blindfold into large vehicles * Apply suggestions from code review Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
This commit is contained in:
parent
941207c45c
commit
b4c72d8255
@ -22,7 +22,5 @@ params ["_unit", "_target"];
|
||||
(_target getVariable [QGVAR(isHandcuffed), false]) &&
|
||||
{isNull (attachedTo _target)} &&
|
||||
{alive _target} &&
|
||||
{isNull objectParent _unit} &&
|
||||
{isNull objectParent _target} &&
|
||||
{(GVAR(blindfolds) findAny (_unit call EFUNC(common,uniqueItems))) != -1} &&
|
||||
{!((goggles _target) in GVAR(blindfolds))}
|
||||
|
@ -22,6 +22,4 @@ params ["_unit", "_target"];
|
||||
(_target getVariable [QGVAR(isHandcuffed), false]) &&
|
||||
{isNull (attachedTo _target)} &&
|
||||
{alive _target} &&
|
||||
{isNull objectParent _unit} &&
|
||||
{isNull objectParent _target} &&
|
||||
{(goggles _target) in GVAR(blindfolds)}
|
||||
|
@ -66,10 +66,16 @@ if (_state) then { // Blindfold target
|
||||
removeGoggles _target;
|
||||
};
|
||||
|
||||
// Handle for things that need to be dropped to the ground
|
||||
// Handle for things that need to be dropped to the ground or in a vehicle inventory
|
||||
if (_dropGoggles) then {
|
||||
private _weaponHolder = nearestObject [_target, "WeaponHolder"];
|
||||
if (isNull _weaponHolder || {_target distance _weaponHolder > 2}) then {
|
||||
// if _target is in a vehicle, use vehicle inventory as container
|
||||
private _inVehicle = !isNull objectParent _target;
|
||||
if (_inVehicle) then {
|
||||
_weaponHolder = objectParent _target;
|
||||
};
|
||||
|
||||
if (!_inVehicle && {isNull _weaponHolder || {_target distance _weaponHolder > 2}}) then {
|
||||
_weaponHolder = createVehicle ["GroundWeaponHolder", [0, 0, 0], [], 0, "NONE"];
|
||||
_weaponHolder setPosASL getPosASL _target;
|
||||
};
|
||||
|
@ -29,7 +29,6 @@ if (_putDownAnim != "") exitWith { false };
|
||||
|
||||
(alive _target) &&
|
||||
{(abs (speed _target)) < 1} &&
|
||||
{(vehicle _target) == _target} &&
|
||||
{(_target getVariable ["ACE_isUnconscious", false]) ||
|
||||
{_target getVariable [QEGVAR(captives,isHandcuffed), false]} ||
|
||||
{_target getVariable [QEGVAR(captives,isSurrendering), false]}}
|
||||
|
@ -39,6 +39,11 @@ if (_doNotDropAmmo && {({_x in _listOfItemsToRemove} count (magazines _target))
|
||||
|
||||
private _holder = objNull;
|
||||
|
||||
// if _target is in a vehicle, use vehicle inventory as container
|
||||
if (!isNull objectParent _target) then {
|
||||
_holder = objectParent _target;
|
||||
};
|
||||
|
||||
//If not dropping ammo, don't use an existing container
|
||||
if (!_doNotDropAmmo) then {
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user