From f5a497332a425932e84c993676440bfb686a36e8 Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Tue, 4 Aug 2015 01:55:09 +0200 Subject: [PATCH] Updated parameterization in Winddeflection module. --- addons/winddeflection/functions/fnc_handleFired.sqf | 6 ++---- addons/winddeflection/functions/fnc_initModuleSettings.sqf | 5 +---- .../winddeflection/functions/fnc_updateTrajectoryPFH.sqf | 7 ++++--- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/addons/winddeflection/functions/fnc_handleFired.sqf b/addons/winddeflection/functions/fnc_handleFired.sqf index d3f9da8153..6c668a8033 100644 --- a/addons/winddeflection/functions/fnc_handleFired.sqf +++ b/addons/winddeflection/functions/fnc_handleFired.sqf @@ -21,9 +21,7 @@ */ #include "script_component.hpp" -private ["_unit", "_bullet"]; -_unit = _this select 0; -_bullet = _this select 6; +params ["_unit", "", "", "", "_ammo", "", "_bullet"]; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false] && (_bullet isKindOf "BulletBase") && (_unit isKindOf "Man")) exitWith {false}; @@ -34,6 +32,6 @@ if (!((_bullet isKindOf "BulletBase") || (_bullet isKindOf "GrenadeBase"))) exit if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {false}; if (!([_unit] call EFUNC(common,isPlayer))) exitWith {false}; -GVAR(trackedBullets) pushBack [_bullet, getNumber(configFile >> "cfgAmmo" >> (_this select 4) >> "airFriction")]; +GVAR(trackedBullets) pushBack [_bullet, getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction")]; true; \ No newline at end of file diff --git a/addons/winddeflection/functions/fnc_initModuleSettings.sqf b/addons/winddeflection/functions/fnc_initModuleSettings.sqf index 40be14a2b2..037ce15c47 100644 --- a/addons/winddeflection/functions/fnc_initModuleSettings.sqf +++ b/addons/winddeflection/functions/fnc_initModuleSettings.sqf @@ -15,10 +15,7 @@ #include "script_component.hpp" -private ["_logic", "_units", "_activated"]; -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; diff --git a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf index 23d0be6b79..baff39516d 100644 --- a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf +++ b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf @@ -18,11 +18,12 @@ [{ // BEGIN_COUNTER(pfeh); - private["_accel", "_accelRef", "_bulletSpeed", "_bulletVelocity", "_deleted", "_deltaT", "_drag", "_dragRef", "_isWind", "_lastTime", "_trueSpeed", "_trueVelocity"]; + private["_accel", "_accelRef", "_bulletSpeed", "_bulletVelocity", "_deleted", "_deltaT", "_drag", "_dragRef", "_isWind", "_trueSpeed", "_trueVelocity"]; - _lastTime = (_this select 0) select 0; + params ["_args"]; + _args params ["_lastTime"]; _deltaT = ACE_time - _lastTime; - (_this select 0) set [0, ACE_time]; + _args set [0, ACE_time]; _deleted = 0; _isWind = (vectorMagnitude ACE_wind > 0);