From 022e7747b121e968cd103b996163999d5a2549c2 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 5 Jul 2016 20:58:32 -0500 Subject: [PATCH] Fix no attack profile on static titan launcher (#4023) --- addons/javelin/functions/fnc_cycleFireMode.sqf | 6 +++--- addons/javelin/functions/fnc_onOpticDraw.sqf | 2 +- addons/javelin/functions/fnc_onOpticLoad.sqf | 6 ++++-- addons/javelin/functions/fnc_showFireMode.sqf | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/addons/javelin/functions/fnc_cycleFireMode.sqf b/addons/javelin/functions/fnc_cycleFireMode.sqf index d14c0cdee5..50609b3468 100644 --- a/addons/javelin/functions/fnc_cycleFireMode.sqf +++ b/addons/javelin/functions/fnc_cycleFireMode.sqf @@ -2,12 +2,12 @@ #include "script_component.hpp" TRACE_1("enter", _this); -private["_player", "_currentFireMode"]; +private _currentShooter = if (ACE_player call CBA_fnc_canUseWeapon) then {ACE_player} else {vehicle ACE_player}; +private _currentFireMode = _currentShooter getVariable["ace_missileguidance_attackProfile", "JAV_TOP"]; -_currentFireMode = ACE_player getVariable["ace_missileguidance_attackProfile", "JAV_TOP"]; if(_currentFireMode == "JAV_DIR") then { _currentFireMode = "JAV_TOP"; } else { _currentFireMode = "JAV_DIR"; }; -ACE_player setVariable["ace_missileguidance_attackProfile", _currentFireMode, false]; +_currentShooter setVariable["ace_missileguidance_attackProfile", _currentFireMode, false]; diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index 20606dc4dd..7d1bf64b33 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -11,7 +11,7 @@ private["_firedEH", "_fov", "_lastTick", "_lockTime", "_maxX", "_maxY", "_minX", private["_offsetX", "_offsetY", "_pos", "_randomLockInterval", "_randomPosWithinBounds", "_range"]; private["_runTime", "_soundTime", "_targetArray", "_zamerny", "_currentShooter"]; -_currentShooter = (vehicle ACE_player); +_currentShooter = if (ACE_player call CBA_fnc_canUseWeapon) then {ACE_player} else {vehicle ACE_player}; #define __OffsetX ((ctrlPosition __JavelinIGUITargetingLineV) select 0) - 0.5 #define __OffsetY ((ctrlPosition __JavelinIGUITargetingLineH) select 1) - 0.5 diff --git a/addons/javelin/functions/fnc_onOpticLoad.sqf b/addons/javelin/functions/fnc_onOpticLoad.sqf index b75f391112..5148ca983f 100644 --- a/addons/javelin/functions/fnc_onOpticLoad.sqf +++ b/addons/javelin/functions/fnc_onOpticLoad.sqf @@ -2,13 +2,15 @@ #include "script_component.hpp" TRACE_1("enter", _this); -#define __LOCKONTIMERANDOM 2 // Deviation in lock on time +#define __LOCKONTIMERANDOM 1 // Deviation in lock on time if((count _this) > 0) then { uiNameSpace setVariable ['ACE_RscOptics_javelin',_this select 0]; }; -ACE_player setVariable ["ace_missileguidance_target",nil, false]; +private _currentShooter = if (ACE_player call CBA_fnc_canUseWeapon) then {ACE_player} else {vehicle ACE_player}; +TRACE_2("shooter",_currentShooter,typeOf _currentShooter); +_currentShooter setVariable ["ace_missileguidance_target", nil, false]; __JavelinIGUISeek ctrlSetTextColor __ColorGray; __JavelinIGUINFOV ctrlSetTextColor __ColorGray; diff --git a/addons/javelin/functions/fnc_showFireMode.sqf b/addons/javelin/functions/fnc_showFireMode.sqf index 5b4f8d7814..95dd038b92 100644 --- a/addons/javelin/functions/fnc_showFireMode.sqf +++ b/addons/javelin/functions/fnc_showFireMode.sqf @@ -2,13 +2,13 @@ #include "script_component.hpp" TRACE_1("enter", _this); -private["_player", "_currentFireMode"]; +private _currentShooter = if (ACE_player call CBA_fnc_canUseWeapon) then {ACE_player} else {vehicle ACE_player}; +private _currentFireMode = _currentShooter getVariable ["ace_missileguidance_attackProfile", "JAV_TOP"]; -_currentFireMode = ACE_player getVariable["ace_missileguidance_attackProfile", "JAV_TOP"]; if(_currentFireMode == "JAV_TOP") then { __JavelinIGUITop ctrlSetTextColor __ColorGreen; __JavelinIGUIDir ctrlSetTextColor __ColorGray; } else { __JavelinIGUITop ctrlSetTextColor __ColorGray; __JavelinIGUIDir ctrlSetTextColor __ColorGreen; -}; \ No newline at end of file +};