From ade6c99daca81f8b7e673b1aab14a93430c68205 Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Tue, 4 Aug 2015 04:24:30 +0200 Subject: [PATCH] Updated parameterization in Viewdistance module. --- addons/viewdistance/functions/fnc_adaptViewDistance.sqf | 4 ++-- addons/viewdistance/functions/fnc_changeViewDistance.sqf | 2 +- addons/viewdistance/functions/fnc_initModule.sqf | 2 +- addons/viewdistance/functions/fnc_returnObjectCoeff.sqf | 8 ++++---- addons/viewdistance/functions/fnc_returnValue.sqf | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf index 2ef4b84ae6..ca03758df5 100644 --- a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf @@ -17,10 +17,10 @@ #include "script_component.hpp" -PARAMS_1(_show_prompt); - private["_land_vehicle","_air_vehicle"]; +params ["_show_prompt"]; + if (!GVAR(enabled) || isNull ACE_player) exitWith {}; _land_vehicle = (vehicle ACE_player) isKindOf "LandVehicle"; diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index 9060254c60..34a3f5ba46 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -20,7 +20,7 @@ private ["_text","_new_view_distance","_view_distance_limit","_object_view_distance_coeff"]; -PARAMS_2(_index_requested,_show_prompt); +params ["_index_requested", "_show_prompt"]; _new_view_distance = [_index_requested] call FUNC(returnValue); // changes the setting index into an actual view distance value _object_view_distance_coeff = [GVAR(objectViewDistanceCoeff)] call FUNC(returnObjectCoeff); // changes the setting index into a coefficient. diff --git a/addons/viewdistance/functions/fnc_initModule.sqf b/addons/viewdistance/functions/fnc_initModule.sqf index 7569383d0c..26072e5b5f 100644 --- a/addons/viewdistance/functions/fnc_initModule.sqf +++ b/addons/viewdistance/functions/fnc_initModule.sqf @@ -17,7 +17,7 @@ if (!isServer) exitWith {}; -PARAMS_3(_logic,_units,_activated); +params ["_logic", "_units", "_activated"]; if (!_activated) exitWith { diag_log text "[ACE]: View Distance Limit Module is placed but NOT active."; diff --git a/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf b/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf index 145b8ae9e6..71a23d7b54 100644 --- a/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf +++ b/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf @@ -1,7 +1,7 @@ /* * Author: Winter * Returns the object view distance coefficient according to the given index - * + * * * Arguments: * 0: Object View Distance setting Index @@ -17,10 +17,10 @@ #include "script_component.hpp" -PARAMS_1(_index); - private ["_return"]; +params ["_index"]; + _return = switch (_index) do { case 0: {0.00}; // Off case 1: {0.20}; // Very Low @@ -31,4 +31,4 @@ _return = switch (_index) do { default {0.50}; // something broke if this returns }; -_return; \ No newline at end of file +_return; diff --git a/addons/viewdistance/functions/fnc_returnValue.sqf b/addons/viewdistance/functions/fnc_returnValue.sqf index fb449cf702..c5ff3b12bd 100644 --- a/addons/viewdistance/functions/fnc_returnValue.sqf +++ b/addons/viewdistance/functions/fnc_returnValue.sqf @@ -17,10 +17,10 @@ #include "script_component.hpp" -PARAMS_1(_index); - private ["_return"]; +params ["_index"] + _return = switch (_index) do { case 0: {-1}; case 1: {500}; @@ -40,4 +40,4 @@ _return = switch (_index) do { default {1000}; }; -_return; \ No newline at end of file +_return;