Only play sound when Spike is launcher. Change onFired to missileguidance

This commit is contained in:
Brandon Danyluk 2022-01-14 13:28:40 -07:00
parent c2ef6b8acc
commit 97f3bb3a7a
4 changed files with 7 additions and 8 deletions

View File

@ -35,6 +35,8 @@ class CfgAmmo {
attackProfiles[] = {"DIR"};
useModeForAttackProfile = 0;
onFired = QFUNC(onFired);
class navigationStates {
class initial {
transitionCondition = QFUNC(midCourseTransition);

View File

@ -16,9 +16,3 @@ class Extended_PostInit_EventHandlers {
};
};
class Extended_FiredBIS_EventHandlers {
class All {
ADDON = QUOTE(_this call FUNC(onFired));
};
};

View File

@ -17,6 +17,8 @@
*/
params ["_key", "_down"];
if ((currentWeapon ACE_PLAYER) != QGVAR(launcher)) exitWith {};
if (_key == SPIKE_KEY_DESIGNATE) then {
if (cameraView == "GUNNER") then {
playSound "ACE_Sound_Click";

View File

@ -15,7 +15,8 @@
*
* Public: No
*/
params ["_shooter","_weapon","","_mode","_ammo","","_projectile"];
params ["_firedEH"];
_firedEH params ["_shooter","_weapon","","_mode","_ammo","","_projectile"];
private _missileGuidanceConfig = (configOf _projectile) >> "ace_missileguidance";
// Setup camera array
@ -86,4 +87,4 @@ GVAR(projectileHashMap) set [hashValue _projectile, [_camera, _preTarget]];
[_cameraArray, _projectile, CBA_missionTime - _lastUpdate, _camera] call FUNC(camera_update);
_args set [2, CBA_missionTime];
}, 0, [_this, _cameraArray, CBA_missionTime, _camera, hashValue _projectile]] call CBA_fnc_addPerFrameHandler;
}, 0, [_firedEH, _cameraArray, CBA_missionTime, _camera, hashValue _projectile]] call CBA_fnc_addPerFrameHandler;