Apply the ufeh to ACE_WindDeflection

This commit is contained in:
esteldunedain 2016-02-06 18:36:20 -03:00
parent 25b767a16b
commit 94ef0c5659
3 changed files with 13 additions and 22 deletions

View File

@ -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));
};
};
};

View File

@ -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);

View File

@ -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;