mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Apply the ufeh to ACE_WindDeflection
This commit is contained in:
parent
25b767a16b
commit
94ef0c5659
@ -8,10 +8,3 @@ class Extended_PostInit_EventHandlers {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
};
|
||||
};
|
||||
class Extended_FiredBIS_EventHandlers {
|
||||
class AllVehicles {
|
||||
class ADDON {
|
||||
firedBIS = QUOTE(_this call FUNC(handleFired));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -8,6 +8,15 @@ GVAR(trackedBullets) = [];
|
||||
//If not enabled, dont't add PFEH
|
||||
if (!GVAR(enabled)) exitWith {};
|
||||
|
||||
// Register fire event handler
|
||||
["firedPlayer", DFUNC(handleFired)] call EFUNC(common,addEventHandler);
|
||||
["firedPlayerNonLocal", DFUNC(handleFired)] call EFUNC(common,addEventHandler);
|
||||
|
||||
if (GVAR(vehicleEnabled)) then {
|
||||
["firedPlayerVehicle", DFUNC(handleFired)] call EFUNC(common,addEventHandler);
|
||||
["firedPlayerVehicleNonLocal", DFUNC(handleFired)] call EFUNC(common,addEventHandler);
|
||||
};
|
||||
|
||||
[] call FUNC(updateTrajectoryPFH);
|
||||
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
@ -1,15 +1,9 @@
|
||||
/*
|
||||
* Author: Glowbal, Ruthberg
|
||||
* Handles wind deflection for projectiles.
|
||||
* Handles wind deflection for projectiles. Called from the unified fired EH only for players on foot and their vehicles if required by settings.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: unit - Object the event handler is assigned to <OBJECT>
|
||||
* 1: weapon - Fired weapon <STRING>
|
||||
* 2: muzzle - Muzzle that was used <STRING>
|
||||
* 3: mode - Current mode of the fired weapon <STRING>
|
||||
* 4: ammo - Ammo used <STRING>
|
||||
* 5: magazine - magazine name which was used <STRING>
|
||||
* 6: projectile - Object of the projectile that was shot <OBJECT>
|
||||
* None. Parameters inherited from EFUNC(common,firedEH)
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
@ -21,17 +15,12 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit", "", "", "", "_ammo", "", "_bullet"];
|
||||
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"];
|
||||
TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret);
|
||||
|
||||
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false] && (_bullet isKindOf "BulletBase") && (_unit isKindOf "Man")) exitWith {false};
|
||||
|
||||
if (!hasInterface) exitWith {false};
|
||||
if (!(GVAR(enabled))) exitWith {false};
|
||||
if (!(GVAR(vehicleEnabled)) && !(_unit isKindOf "Man")) exitWith {false};
|
||||
if (!((_bullet isKindOf "BulletBase") || (_bullet isKindOf "GrenadeBase"))) exitWith {false};
|
||||
if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {false};
|
||||
if (!([_unit] call EFUNC(common,isPlayer))) exitWith {false};
|
||||
|
||||
GVAR(trackedBullets) pushBack [_bullet, getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction")];
|
||||
|
||||
true;
|
Loading…
Reference in New Issue
Block a user