diff --git a/addons/missileguidance/XEH_post_init.sqf b/addons/missileguidance/XEH_post_init.sqf index dc30361926..deaeef669d 100644 --- a/addons/missileguidance/XEH_post_init.sqf +++ b/addons/missileguidance/XEH_post_init.sqf @@ -1,2 +1,3 @@ #include "script_component.hpp" +[QGVAR(handoff), {_this call FUNC(handleHandoff)}] call EFUNC(common,addEventHandler); diff --git a/addons/missileguidance/XEH_pre_init.sqf b/addons/missileguidance/XEH_pre_init.sqf index d19b8475c9..08219e02f0 100644 --- a/addons/missileguidance/XEH_pre_init.sqf +++ b/addons/missileguidance/XEH_pre_init.sqf @@ -14,6 +14,9 @@ PREP(guidancePFH); PREP(doAttackProfile); PREP(doSeekerSearch); +PREP(doHandoff); +PREP(handleHandoff); + // Attack Profiles PREP(attackProfile_LIN); PREP(attackProfile_DIR); diff --git a/addons/missileguidance/functions/fnc_doHandoff.sqf b/addons/missileguidance/functions/fnc_doHandoff.sqf new file mode 100644 index 0000000000..d99998c8c4 --- /dev/null +++ b/addons/missileguidance/functions/fnc_doHandoff.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" +PARAMS_2(_target,_args); + +[QGVAR(handoff), [_target, _args]] call EFUNC(common,globalEvent); \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_handleHandoff.sqf b/addons/missileguidance/functions/fnc_handleHandoff.sqf new file mode 100644 index 0000000000..2f1dfac8e7 --- /dev/null +++ b/addons/missileguidance/functions/fnc_handleHandoff.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" +PARAMS_2(_target,_args); + +if(!local _target) exitWith {}; + +[FUNC(guidancePFH), 0, _args] call cba_fnc_addPerFrameHandler; \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf index dd96821692..e36742bce5 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -60,27 +60,37 @@ if(isNil "_target") then { }; TRACE_4("Beginning ACE guidance system",_target,_ammo,_seekerType,_attackProfile); -[FUNC(guidancePFH), 0, [_this, - [_shooter, - [_target, _targetPos, _launchPos], - _seekerType, - _attackProfile, - _lockMode - ], - [ - getNumber ( _config >> "minDeflection" ), - getNumber ( _config >> "maxDeflection" ), - getNumber ( _config >> "incDeflection" ) - ], - [ - getNumber ( _config >> "seekerAngle" ), - getNumber ( _config >> "seekerAccuracy" ), - getNumber ( _config >> "seekerMaxRange" ) - ], - [ diag_tickTime, [], [] ] - ] -] call cba_fnc_addPerFrameHandler; +_args = [_this, + [_shooter, + [_target, _targetPos, _launchPos], + _seekerType, + _attackProfile, + _lockMode + ], + [ + getNumber ( _config >> "minDeflection" ), + getNumber ( _config >> "maxDeflection" ), + getNumber ( _config >> "incDeflection" ) + ], + [ + getNumber ( _config >> "seekerAngle" ), + getNumber ( _config >> "seekerAccuracy" ), + getNumber ( _config >> "seekerMaxRange" ) + ], + [ diag_tickTime, [], [] ] + ]; + +// Hand off to the guiding unit. We just use local player so local PFH fires for now +// Laser code needs to give us a shooter for LOBL, or the seeker unit needs to be able to shift locality +// Based on its homing laser +// Lasers need to be handled in a special LOAL/LOBL case +_guidingUnit = ACE_player; +if(local _guidingUnit) then { + [FUNC(guidancePFH), 0, _args ] call cba_fnc_addPerFrameHandler; +} else { + [QGVAR(handoff), [_guidingUnit, _args] ] call FUNC(doHandoff); +}; /* Clears locking settings (vehicle _shooter) setVariable [QGVAR(target), nil]; (vehicle _shooter) setVariable [QGVAR(seekerType), nil]; diff --git a/tools/github_privates_bot.py b/tools/github_privates_bot.py new file mode 100644 index 0000000000..4ef04eb33c --- /dev/null +++ b/tools/github_privates_bot.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 + +import os +import argparse + +from pygithub3 import Github + +def main(): + gh = Github(user='acemod', repo='ACE3') + + pull_requests = gh.pull_requests.list().all() + + for request in pull_requests: + files = gh.pull_requests.list_files(request.number).all() + + for file in files: + # print file.filename + if '.sqf' in file.filename: + print file + +if __name__ == "__main__": + main() \ No newline at end of file