Fixed/improved checks

This commit is contained in:
johnb432 2024-01-07 16:29:01 +01:00
parent 04238fd382
commit 4a5f056d71
2 changed files with 8 additions and 10 deletions

View File

@ -28,15 +28,14 @@ if ((_unit getHitPointDamage "HitLegs") >= 0.5) exitWith {false};
// Static weapons need to be empty for carrying (ignore UAV AI)
if (_target isKindOf "StaticWeapon") exitWith {
(crew _target) findIf {getText (configOf _x >> "simulation") != "UAVPilot"} == -1
(crew _target) findIf {!unitIsUAV _x} == -1
};
// Units need to be unconscious or limping; Units also need to not be in ragdoll, as that causes desync issues
if (_target isKindOf "CAManBase") exitWith {
isAwake _target && // not ragdolled
{lifeState _target == "INCAPACITATED" ||
{_target getHitPointDamage "HitLegs" >= 0.5} ||
{(animationState _target) in ["", "unconscious", "deadstate"]}}
(isAwake _target != alive _target) && // not ragdolled
{!(lifeState _target in ["HEALTHY", "INJURED"]) ||
{_target getHitPointDamage "HitLegs" >= 0.5}}
};
// Check max items for WeaponHolders

View File

@ -24,15 +24,14 @@ if !([_unit, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)) exi
// Static weapons need to be empty for dragging (ignore UAV AI)
if (_target isKindOf "StaticWeapon") exitWith {
(crew _target) findIf {getText (configOf _x >> "simulation") != "UAVPilot"} == -1
(crew _target) findIf {!unitIsUAV _x} == -1
};
// Units need to be unconscious or limping; Units also need to not be in ragdoll, as that causes desync issues
if (_target isKindOf "CAManBase") exitWith {
isAwake _target && // not ragdolled
{lifeState _target == "INCAPACITATED" ||
{_target getHitPointDamage "HitLegs" >= 0.5} ||
{(animationState _target) in ["", "unconscious", "deadstate"]}}
(isAwake _target != alive _target) && // not ragdolled
{!(lifeState _target in ["HEALTHY", "INJURED"]) ||
{_target getHitPointDamage "HitLegs" >= 0.5}}
};
// Check max items for WeaponHolders