improve static line protection logic
All checks were successful
Generate testing snapshot / Create testing release (push) Successful in 37s
All checks were successful
Generate testing snapshot / Create testing release (push) Successful in 37s
This commit is contained in:
@@ -14,10 +14,27 @@ player addEventHandler ["GetOutMan", {
|
|||||||
((getPosATL _vehicle)#2) < 100
|
((getPosATL _vehicle)#2) < 100
|
||||||
) exitWith {};
|
) exitWith {};
|
||||||
|
|
||||||
|
// disable damage for the unit to avoid collision damage
|
||||||
_unit allowDamage false;
|
_unit allowDamage false;
|
||||||
(vehicle _unit) allowDamage false;
|
// tested - vehicle _unit is the _unit, as this EH runs when they have left the vehicle
|
||||||
[{
|
|
||||||
_this allowDamage true;
|
|
||||||
(vehicle _this) allowDamage true;
|
[
|
||||||
}, _unit, 5] call CBA_fnc_waitAndExecute;
|
{!isNull (objectParent _this)}, // condition - wait until player re-enters vehicle (chute)
|
||||||
|
{
|
||||||
|
// if they enter a chute within 5 seconds, disable chute damage
|
||||||
|
(vehicle _this) allowDamage false;
|
||||||
|
// then wait X seconds and re-enable damage for both
|
||||||
|
[{
|
||||||
|
_this allowDamage true;
|
||||||
|
(vehicle _this) allowDamage true;
|
||||||
|
}, _this, 5] call CBA_fnc_waitAndExecute;
|
||||||
|
},
|
||||||
|
_unit, // args
|
||||||
|
2, // timeout
|
||||||
|
{ // run on timeout, if for some reason they don't enter a chute
|
||||||
|
// re-enable damage for unit
|
||||||
|
_this allowDamage true;
|
||||||
|
}
|
||||||
|
] call CBA_fnc_waitUntilAndExecute;
|
||||||
}];
|
}];
|
||||||
Reference in New Issue
Block a user