Workaround to prevent accidentally canceling the ladder deployment

This commit is contained in:
ulteq 2015-06-13 00:01:48 +02:00
parent 8336f1d192
commit 4160c7668c
2 changed files with 3 additions and 1 deletions

View File

@ -1,12 +1,13 @@
#include "script_component.hpp" #include "script_component.hpp"
GVAR(ladder) = objNull; GVAR(ladder) = objNull;
GVAR(cancelTime) = 0;
GVAR(currentStep) = 3; GVAR(currentStep) = 3;
GVAR(currentAngle) = 0; GVAR(currentAngle) = 0;
// Cancel tactical ladder deployment if the interact menu is opened // Cancel tactical ladder deployment if the interact menu is opened
["interactMenuOpened", { ["interactMenuOpened", {
if (!isNull GVAR(ladder)) then { if ((ACE_time > GVAR(cancelTime)) && !isNull GVAR(ladder)) then {
GVAR(ladder) call FUNC(cancelTLdeploy); GVAR(ladder) call FUNC(cancelTLdeploy);
}; };
}] call EFUNC(common,addEventHandler); }] call EFUNC(common,addEventHandler);

View File

@ -33,6 +33,7 @@ _ladder animate ["rotate", 0];
} forEach ["extract_1", "extract_2", "extract_3"]; // Extract ladder at head height (extract_3) } forEach ["extract_1", "extract_2", "extract_3"]; // Extract ladder at head height (extract_3)
GVAR(ladder) = _ladder; GVAR(ladder) = _ladder;
GVAR(cancelTime) = ACE_time + 1; // Workaround to prevent accidental canceling
GVAR(currentStep) = 3; GVAR(currentStep) = 3;
GVAR(currentAngle) = 0; GVAR(currentAngle) = 0;