mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
random lock interval was causing phasing.
This commit is contained in:
parent
1dd41a00ba
commit
24830f815f
@ -4,7 +4,7 @@ TRACE_1("enter", _this);
|
||||
|
||||
#define __TRACKINTERVAL 0 // how frequent the check should be.
|
||||
#define __LOCKONTIME 3 // Lock on won't occur sooner
|
||||
#define __LOCKONTIMERANDOM 2 // Deviation in lock on time
|
||||
|
||||
|
||||
#define __OffsetX ((ctrlPosition __JavelinIGUITargetingLineV) select 0) - 0.5
|
||||
#define __OffsetY ((ctrlPosition __JavelinIGUITargetingLineH) select 1) - 0.5
|
||||
@ -39,6 +39,7 @@ _currentTarget = _args select 1;
|
||||
_runTime = _args select 2;
|
||||
_lockTime = _args select 3;
|
||||
_soundTime = _args select 4;
|
||||
_randomLockInterval = _args select 5;
|
||||
|
||||
// Find a target within the optic range
|
||||
_newTarget = objNull;
|
||||
@ -135,7 +136,7 @@ if (isNull _newTarget) then {
|
||||
|
||||
playSound "ACE_Javelin_Locking";
|
||||
} else {
|
||||
if(diag_tickTime - _lockTime > __LOCKONTIME + (random __LOCKONTIMERANDOM)) then {
|
||||
if(diag_tickTime - _lockTime > __LOCKONTIME + _randomLockInterval) then {
|
||||
TRACE_2("LOCKED!", _currentTarget, _lockTime);
|
||||
|
||||
__JavelinIGUISeek ctrlSetTextColor __ColorGreen;
|
||||
|
@ -2,6 +2,8 @@
|
||||
#include "script_component.hpp"
|
||||
TRACE_1("enter", _this);
|
||||
|
||||
#define __LOCKONTIMERANDOM 2 // Deviation in lock on time
|
||||
|
||||
if((count _this) > 0) then {
|
||||
uiNameSpace setVariable ['ACE_RscOptics_javelin',_this select 0];
|
||||
};
|
||||
@ -22,10 +24,13 @@ uiNameSpace setVariable [QGVAR(arguments),
|
||||
objNull, // currentTargetObject
|
||||
0, // Run Time
|
||||
0, // Lock Time
|
||||
0 // Sound timer
|
||||
0, // Sound timer
|
||||
(random __LOCKONTIMERANDOM) // random lock time addition
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
|
||||
_pfh_handle = uiNamespace getVariable ["ACE_RscOptics_javelin_PFH", nil];
|
||||
if(isNil "_pfh_handle") then {
|
||||
_pfh_handle = [FUNC(onOpticDraw), 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
|
Loading…
Reference in New Issue
Block a user