diff --git a/addons/fcs/CfgEventHandlers.hpp b/addons/fcs/CfgEventHandlers.hpp index ab41fa904b..8c5b768ca9 100644 --- a/addons/fcs/CfgEventHandlers.hpp +++ b/addons/fcs/CfgEventHandlers.hpp @@ -76,36 +76,3 @@ class Extended_Respawn_EventHandlers { }; }; }; - -class Extended_FiredBIS_EventHandlers { - class Tank { - class ADDON { - firedBIS = QUOTE(_this call FUNC(firedEH)); - }; - }; - class Car { - class ADDON { - firedBIS = QUOTE(_this call FUNC(firedEH)); - }; - }; - class Helicopter { - class ADDON { - firedBIS = QUOTE(_this call FUNC(firedEH)); - }; - }; - class Plane { - class ADDON { - firedBIS = QUOTE(_this call FUNC(firedEH)); - }; - }; - class Ship_F { - class ADDON { - firedBIS = QUOTE(_this call FUNC(firedEH)); - }; - }; - class StaticWeapon { - class ADDON { - firedBIS = QUOTE(_this call FUNC(firedEH)); - }; - }; -}; diff --git a/addons/fcs/XEH_postInit.sqf b/addons/fcs/XEH_postInit.sqf index a4f8020a9f..25fd09ba8c 100644 --- a/addons/fcs/XEH_postInit.sqf +++ b/addons/fcs/XEH_postInit.sqf @@ -15,5 +15,9 @@ if (!hasInterface) exitWith {}; }; }] call EFUNC(common,addEventHandler); +// Register fire event handler +["firedPlayerVehicle", DFUNC(firedEH)] call EFUNC(common,addEventHandler); +["firedPlayerVehicleNonLocal", DFUNC(firedEH)] call EFUNC(common,addEventHandler); + // Register event for global updates [QGVAR(forceUpdate), {[ACE_player] call FUNC(onForceUpdate)}] call EFUNC(common,addEventHandler); diff --git a/addons/fcs/functions/fnc_firedEH.sqf b/addons/fcs/functions/fnc_firedEH.sqf index 237aed8ac1..e407b44293 100644 --- a/addons/fcs/functions/fnc_firedEH.sqf +++ b/addons/fcs/functions/fnc_firedEH.sqf @@ -1,9 +1,9 @@ /* * Author: KoffeinFlummi - * Adjusts the direction of a shell. + * Adjusts the direction of a shell. Only gets called if the gunner is a player * * Arguments: - * -> arguments of the FiredBIS EH + * None. Parameters inherited from EFUNC(common,firedEH) * * Return Value: * None @@ -12,9 +12,6 @@ */ #include "script_component.hpp" -params ["_vehicle", "_weapon", "", "", "_ammo", "_magazine", "_projectile"]; - -private _gunner = [_vehicle, _weapon] call EFUNC(common,getGunner); private _turret = _gunner call EFUNC(common,getTurretIndex); // Exit if the unit isn't a player @@ -36,7 +33,7 @@ private _offset = 0; [_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, 0] call EFUNC(common,changeProjectileDirection); -// Remove the platform velocity +// Remove the platform velocity if (vectorMagnitude velocity _vehicle > 2) then { private _sumVelocity = (velocity _projectile) vectorDiff (velocity _vehicle);