Add sanity checks, fix explosives checks

This commit is contained in:
jonpas 2016-03-06 12:06:17 +01:00
parent ef95e278f9
commit 52007fab6a
5 changed files with 11 additions and 9 deletions

View File

@ -18,11 +18,6 @@
params ["_unit", "_key"];
if (_key != 1) exitWith {};
if (_unit == ACE_player &&
{([_unit, objNull, ["isNotSwimming"]] call EFUNC(common,canInteractWith))} &&
{(_magClassname in (magazines _unit))}
) exitWith {};
if (_key != 1 || {!GVAR(pfeh_running)}) exitWith {};
GVAR(placeAction) = PLACE_CANCEL;

View File

@ -141,6 +141,13 @@ GVAR(TweakedAngle) = 0;
//Don't allow placing in a bad position:
if (_badPosition && {GVAR(placeAction) == PLACE_APPROVE}) then {GVAR(placeAction) = PLACE_WAITING;};
if (_unit != ACE_player ||
{!([_unit, objNull, ["isNotSwimming"]] call EFUNC(common,canInteractWith))} ||
{!(_magClassname in (magazines _unit))}
) then {
GVAR(placeAction) = PLACE_CANCEL;
};
if (GVAR(placeAction) != PLACE_WAITING) then {
[_pfID] call CBA_fnc_removePerFrameHandler;
GVAR(pfeh_running) = false;

View File

@ -18,7 +18,7 @@
params ["_unit", "_key"];
if (_key != 1) exitWith {};
if (_key != 1 || {GVAR(deployPFH) == -1}) exitWith {};
// enable running again
[_unit, "forceWalk", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set);

View File

@ -20,7 +20,7 @@
params ["_unit", "_key"];
if (_key != 1) exitWith {};
if (_key != 1 || {isNull GVAR(ladder)}) exitWith {};
// enable running again
[_unit, "forceWalk", "ACE_Ladder", false] call EFUNC(common,statusEffect_set);

View File

@ -18,7 +18,7 @@
params ["_unit", "_key"];
if (_key != 1) exitWith {};
if (_key != 1 || {GVAR(digPFH) == -1}) exitWith {};
// enable running again
[_unit, "forceWalk", "ACE_Trenches", false] call EFUNC(common,statusEffect_set);