Merge branch 'master' of https://github.com/KoffeinFlummi/ACE3 into windWeatherOverhaul

This commit is contained in:
ulteq 2015-04-22 19:47:06 +02:00
commit 74888b4fff
2 changed files with 13 additions and 10 deletions

View File

@ -9,7 +9,9 @@ private["_apos", "_aposX", "_aposY", "_args", "_boundsInput", "_bpos", "_canFire
private["_constraintLeft", "_constraintRight", "_constraintTop", "_currentTarget", "_fireDisabledEH"];
private["_firedEH", "_fov", "_lastTick", "_lockTime", "_maxX", "_maxY", "_minX", "_minY", "_newTarget"];
private["_offsetX", "_offsetY", "_pos", "_randomLockInterval", "_randomPosWithinBounds", "_range"];
private["_runTime", "_soundTime", "_targetArray", "_zamerny"];
private["_runTime", "_soundTime", "_targetArray", "_zamerny", "_currentShooter"];
_currentShooter = (vehicle ACE_player);
#define __OffsetX ((ctrlPosition __JavelinIGUITargetingLineV) select 0) - 0.5
#define __OffsetY ((ctrlPosition __JavelinIGUITargetingLineH) select 1) - 0.5
@ -128,7 +130,7 @@ FUNC(disableFire) = {
if(_firedEH < 0 && difficulty > 0) then {
_firedEH = [ACE_player, "DefaultAction", {true}, {
_canFire = ACE_player getVariable["ace_missileguidance_target", nil];
_canFire = _currentShooter getVariable["ace_missileguidance_target", nil];
if(!isNil "_canFire") exitWith { false };
true
}] call EFUNC(common,addActionEventHandler);
@ -155,7 +157,7 @@ if (isNull _newTarget) then {
__JavelinIGUITargetingLines ctrlShow false;
__JavelinIGUITargetingConstraints ctrlShow false;
ACE_player setVariable ["ace_missileguidance_target",nil, false];
_currentShooter setVariable ["ace_missileguidance_target",nil, false];
// Disallow fire
_fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire);
@ -212,7 +214,7 @@ if (isNull _newTarget) then {
{_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingGateTL,__JavelinIGUITargetingGateTR,__JavelinIGUITargetingGateBL,__JavelinIGUITargetingGateBR];
ACE_player setVariable["ace_missileguidance_target", _currentTarget, false];
_currentShooter setVariable["ace_missileguidance_target", _currentTarget, false];
// Allow fire
_fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire);
@ -227,7 +229,7 @@ if (isNull _newTarget) then {
__JavelinIGUITargetingConstrains ctrlShow true;
__JavelinIGUITargetingLines ctrlShow false;
ACE_player setVariable["ace_missileguidance_target", nil, false];
_currentShooter setVariable["ace_missileguidance_target", nil, false];
_boundsInput = if (_currentTarget isKindOf "CAManBase") then {
[_newTarget,[-1,-1,-2],_currentTarget selectionPosition "body"];
@ -270,7 +272,7 @@ if (isNull _newTarget) then {
__JavelinIGUITargetingLines ctrlShow false;
__JavelinIGUITargetingConstraints ctrlShow false;
ACE_player setVariable ["ace_missileguidance_target",nil, false];
_currentShooter setVariable ["ace_missileguidance_target",nil, false];
// Disallow fire
_fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire);

View File

@ -33,7 +33,8 @@ uiNameSpace setVariable [QGVAR(arguments),
_pfh_handle = uiNamespace getVariable ["ACE_RscOptics_javelin_PFH", nil];
if(isNil "_pfh_handle") then {
_pfh_handle = [FUNC(onOpticDraw), 0, []] call CBA_fnc_addPerFrameHandler;
uiNamespace setVariable["ACE_RscOptics_javelin_PFH", _pfh_handle];
};
if(!isNil "_pfh_handle") then {
[] call FUNC(onOpticUnload); // Unload optic if it was already loaded
};
_pfh_handle = [FUNC(onOpticDraw), 0, []] call CBA_fnc_addPerFrameHandler;
uiNamespace setVariable["ACE_RscOptics_javelin_PFH", _pfh_handle];