Fix javelin fire block not being removed (#4228)

This commit is contained in:
PabstMirror 2016-08-11 13:30:28 -05:00 committed by GitHub
parent 5e40c24985
commit a2da54bfec
2 changed files with 24 additions and 21 deletions

View File

@ -7,4 +7,28 @@ ADDON = false;
GVAR(isLockKeyDown) = false; GVAR(isLockKeyDown) = false;
GVAR(pfehID) = -1; GVAR(pfehID) = -1;
DFUNC(disableFire) = {
params ["_firedEH"];
if(_firedEH < 0 && {difficulty > 0}) then {
_firedEH = [ACE_player, "DefaultAction", {true}, {
_canFire = (_this select 1) getVariable["ace_missileguidance_target", nil];
if(!isNil "_canFire") exitWith { false };
true
}] call EFUNC(common,addActionEventHandler);
TRACE_1("added",_firedEH);
};
_firedEH
};
DFUNC(enableFire) = {
params ["_firedEH"];
if(_firedEH >= 0 && {difficulty > 0}) then {
TRACE_1("removing",_firedEH);
[ACE_player, "DefaultAction", _firedEH] call EFUNC(common,removeActionEventHandler);
};
-1
};
ADDON = true; ADDON = true;

View File

@ -146,27 +146,6 @@ if((call CBA_fnc_getFoV) select 1 > 9) then {
__JavelinIGUIWFOV ctrlSetTextColor __ColorGreen; __JavelinIGUIWFOV ctrlSetTextColor __ColorGreen;
}; };
FUNC(disableFire) = {
_firedEH = _this select 0;
if(_firedEH < 0 && difficulty > 0) then {
_firedEH = [ACE_player, "DefaultAction", {true}, {
_canFire = (_this select 1) getVariable["ace_missileguidance_target", nil];
if(!isNil "_canFire") exitWith { false };
true
}] call EFUNC(common,addActionEventHandler);
};
_firedEH
};
FUNC(enableFire) = {
_firedEH = _this select 0;
if(_firedEH > 0 && difficulty > 0) then {
[ACE_player, "DefaultAction", _firedEH] call EFUNC(common,removeActionEventHandler);
};
-1
};
if (isNull _newTarget) then { if (isNull _newTarget) then {
// No targets found // No targets found
_currentTarget = objNull; _currentTarget = objNull;