Dragging - Add limping check to carrier and improve limping check for target unit (#9251)

* fix limping damage threshold

* add check for carrier not limping
This commit is contained in:
Grim 2023-07-10 06:45:53 +03:00 committed by GitHub
parent 8032ccacfc
commit 535662b883
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -31,10 +31,10 @@ if (_target isKindOf "StaticWeapon") exitWith {
crew _target findIf {getText (configOf _x >> "simulation") != "UAVPilot"} == -1
};
// Units need to be unconscious or be limping
// Units need to be unconscious or limping
if (_target isKindOf "CAManBase") exitWith {
lifeState _target isEqualTo "INCAPACITATED"
|| {_target getHitPointDamage "HitLegs" > 0.4}
|| {_target getHitPointDamage "HitLegs" >= 0.5}
};
// Check max items for WeaponHolders

View File

@ -27,10 +27,10 @@ if (_target isKindOf "StaticWeapon") exitWith {
crew _target findIf {getText (configOf _x >> "simulation") != "UAVPilot"} == -1
};
// Units need to be unconscious or be limping
// Units need to be unconscious or limping
if (_target isKindOf "CAManBase") exitWith {
lifeState _target isEqualTo "INCAPACITATED"
|| {_target getHitPointDamage "HitLegs" > 0.4}
|| {_target getHitPointDamage "HitLegs" >= 0.5}
};
// Check max items for WeaponHolders

View File

@ -33,8 +33,8 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
if (!alive _target || {_unit distance _target > 10}) exitWith {
// drop if the crate is destroyed OR target moved away from carrier (weapon disassembled) OR carrier starts limping
if !(alive _target && {_unit distance _target <= 10} && {_unit getHitPointDamage "HitLegs" < 0.5}) exitWith {
TRACE_2("dead/distance",_unit,_target);
if ((_unit distance _target > 10) && {(CBA_missionTime - _startTime) < 1}) exitWith {
//attachTo seems to have some kind of network delay and target can return an odd position during the first few frames,