From 5dea25d311806ff89342b86b177d10a65f6e772f Mon Sep 17 00:00:00 2001 From: trapw0w <28637553+trapw0w@users.noreply.github.com> Date: Sat, 6 Jun 2020 12:55:30 +1000 Subject: [PATCH 1/3] Replacement of BIS_fnc_param - Changed all instances of BIS_fnc_param to param or params for performance reasons. - Tested fuel, cargo and damage persistence - Tested ALiVE carry, stow --- addons/sys_logistics/fnc_canCarry.sqf | 6 +- addons/sys_logistics/fnc_canLift.sqf | 5 +- addons/sys_logistics/fnc_canStow.sqf | 5 +- addons/sys_logistics/fnc_canTow.sqf | 5 +- addons/sys_logistics/fnc_getObjectCargo.sqf | 12 +-- addons/sys_logistics/fnc_getObjectFuel.sqf | 4 +- addons/sys_logistics/fnc_getObjectState.sqf | 2 +- addons/sys_logistics/fnc_logistics.sqf | 88 ++++++++------------ addons/sys_logistics/fnc_setObjectCargo.sqf | 18 ++-- addons/sys_logistics/fnc_setObjectDamage.sqf | 5 +- addons/sys_logistics/fnc_setObjectFuel.sqf | 10 +-- 11 files changed, 62 insertions(+), 98 deletions(-) diff --git a/addons/sys_logistics/fnc_canCarry.sqf b/addons/sys_logistics/fnc_canCarry.sqf index 6ccb4921f..4e27b5a97 100644 --- a/addons/sys_logistics/fnc_canCarry.sqf +++ b/addons/sys_logistics/fnc_canCarry.sqf @@ -24,10 +24,10 @@ Peer Reviewed: nil ---------------------------------------------------------------------------- */ -private ["_object","_container","_containerCanCarry","_objectCanCarry","_canCarry","_blacklist"]; +params[["_object", objNull, [objNull]], ["_container", objNull, [objNull]]]; + +private ["_containerCanCarry","_objectCanCarry","_canCarry","_blacklist"]; -_object = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -_container = [_this, 1, objNull, [objNull]] call BIS_fnc_param; _allowedContainers = GVAR(CARRYABLE) select 0; _allowedObjects = GVAR(CARRYABLE) select 1; _blackList = GVAR(CARRYABLE) select 2; diff --git a/addons/sys_logistics/fnc_canLift.sqf b/addons/sys_logistics/fnc_canLift.sqf index b8935487c..e9c69ff7d 100644 --- a/addons/sys_logistics/fnc_canLift.sqf +++ b/addons/sys_logistics/fnc_canLift.sqf @@ -23,11 +23,10 @@ Highhead Peer Reviewed: nil ---------------------------------------------------------------------------- */ +params[["_object", objNull, [objNull]], ["_container", objNull, [objNull]]]; -private ["_object","_container","_containerCanLift","_objectCanLift","_canLift","_blacklist"]; +private ["_containerCanLift","_objectCanLift","_canLift","_blacklist"]; -_object = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -_container = [_this, 1, objNull, [objNull]] call BIS_fnc_param; _allowedContainers = GVAR(LIFTABLE) select 0; _allowedObjects = GVAR(LIFTABLE) select 1; _blacklist = GVAR(LIFTABLE) select 2; diff --git a/addons/sys_logistics/fnc_canStow.sqf b/addons/sys_logistics/fnc_canStow.sqf index 6f3ef6c48..b328cef5f 100644 --- a/addons/sys_logistics/fnc_canStow.sqf +++ b/addons/sys_logistics/fnc_canStow.sqf @@ -23,11 +23,10 @@ Highhead Peer Reviewed: nil ---------------------------------------------------------------------------- */ +params[["_object", objNull, [objNull]], ["_container", objNull, [objNull]]]; -private ["_object","_container","_containerCanStow","_objectCanStow","_canStow","_blacklist"]; +private ["_containerCanStow","_objectCanStow","_canStow","_blacklist"]; -_object = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -_container = [_this, 1, objNull, [objNull]] call BIS_fnc_param; _allowedContainers = GVAR(STOWABLE) select 0; _allowedObjects = GVAR(STOWABLE) select 1; _blacklist = GVAR(STOWABLE) select 2; diff --git a/addons/sys_logistics/fnc_canTow.sqf b/addons/sys_logistics/fnc_canTow.sqf index 7d1ea80be..7f8c1a0c1 100644 --- a/addons/sys_logistics/fnc_canTow.sqf +++ b/addons/sys_logistics/fnc_canTow.sqf @@ -23,11 +23,10 @@ Highhead Peer Reviewed: nil ---------------------------------------------------------------------------- */ +params[["_object", objNull, [objNull]], ["_container", objNull, [objNull]]]; -private ["_object","_container","_containerCanTow","_objectCanTow","_canTow","_blacklist"]; +private ["_containerCanTow","_objectCanTow","_canTow","_blacklist"]; -_object = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -_container = [_this, 1, objNull, [objNull]] call BIS_fnc_param; _allowedContainers = GVAR(TOWABLE) select 0; _allowedObjects = GVAR(TOWABLE) select 1; _blacklist = GVAR(TOWABLE) select 2; diff --git a/addons/sys_logistics/fnc_getObjectCargo.sqf b/addons/sys_logistics/fnc_getObjectCargo.sqf index 760935cc8..c6617cec9 100644 --- a/addons/sys_logistics/fnc_getObjectCargo.sqf +++ b/addons/sys_logistics/fnc_getObjectCargo.sqf @@ -26,15 +26,15 @@ Highhead Peer Reviewed: nil ---------------------------------------------------------------------------- */ +params[["_object", objNull, [objNull]]]; -private ["_object","_cargo","_weapons","_magazines","_items","_ammo"]; +_weapons = [getWeaponCargo _object] param [0, [], [[]]]; +_magazines = [getMagazineCargo _object] param [0, [], [[]]]; +_items = [getItemCargo _object] param [0, [], [[]]]; -_object = [_this, 0, objNull, [objNull]] call BIS_fnc_param; +_ammo = [if ({_object isKindOf _x} count ["ReammoBox","ReammoBox_F"] == 0) then {magazinesAmmo _object} else {[]}] param [0, [], [[]]]; // Thank you BIS, magazinesAmmo _box returns different resultset than magazinesAmmo _car. Applause! -_weapons = [[getWeaponCargo _object], 0, [], [[]]] call BIS_fnc_param; -_magazines = [[getMagazineCargo _object], 0, [], [[]]] call BIS_fnc_param; -_items = [[getItemCargo _object], 0, [], [[]]] call BIS_fnc_param; -_ammo = [[if ({_object isKindOf _x} count ["ReammoBox","ReammoBox_F"] == 0) then {magazinesAmmo _object} else {[]}], 0, [], [[]]] call BIS_fnc_param; // Thank you BIS, magazinesAmmo _box returns different resultset than magazinesAmmo _car. Applause! +private ["_cargo"]; _cargo = []; { diff --git a/addons/sys_logistics/fnc_getObjectFuel.sqf b/addons/sys_logistics/fnc_getObjectFuel.sqf index 3be89158c..a74f1a7a1 100644 --- a/addons/sys_logistics/fnc_getObjectFuel.sqf +++ b/addons/sys_logistics/fnc_getObjectFuel.sqf @@ -23,9 +23,7 @@ Peer Reviewed: nil ---------------------------------------------------------------------------- */ -private ["_object"]; - -_object = [_this, 0, objNull, [objNull]] call BIS_fnc_param; +params[["_object", objNull, [objNull]]]; if (isNull _object) exitwith {}; diff --git a/addons/sys_logistics/fnc_getObjectState.sqf b/addons/sys_logistics/fnc_getObjectState.sqf index 8b2a5fd8d..0ea652b9e 100644 --- a/addons/sys_logistics/fnc_getObjectState.sqf +++ b/addons/sys_logistics/fnc_getObjectState.sqf @@ -31,7 +31,7 @@ switch (typename _this) do { case ("ARRAY") : {_object = _this}; }; -_object = [_this, 0, objNull, [objNull]] call BIS_fnc_param; +params[["_object", objNull, [objNull]]]; _id = [MOD(SYS_LOGISTICS),"id",_object] call ALiVE_fnc_logistics; [MOD(SYS_LOGISTICS),"updateObject",[_object]] call ALiVE_fnc_logistics; diff --git a/addons/sys_logistics/fnc_logistics.sqf b/addons/sys_logistics/fnc_logistics.sqf index bc0045ab3..da04924de 100644 --- a/addons/sys_logistics/fnc_logistics.sqf +++ b/addons/sys_logistics/fnc_logistics.sqf @@ -317,9 +317,8 @@ switch (_operation) do { [[_logic, _operation, _args],"ALIVE_fnc_logistics", false, false] call BIS_fnc_MP; }; - private ["_object","_id"]; - - _object = [_args, 0, objNull, [objNull,""]] call BIS_fnc_param; + private ["_id"]; + _object = _args param [0, objNull, [objNull, ""]]; switch (typeName _object) do { case ("OBJECT") : {_id = _object getvariable QGVAR(ID)}; @@ -342,9 +341,9 @@ switch (_operation) do { case "id" : { if (isnil "_args") exitwith {}; - private ["_object","_id"]; + private ["_id", "_object"]; - _object = [_args, 0, objNull, [objNull,""]] call BIS_fnc_param; + _object = _args param [0, objNull, [objNull, ""]]; _id = _object getvariable QGVAR(ID); if (isnil "_id") then { @@ -358,10 +357,9 @@ switch (_operation) do { case "carryObject": { if (isnil "_args") exitwith {}; - private ["_object","_container","_objectID","_containerID"]; + private ["_objectID","_containerID"]; - _object = [_args, 0, objNull, [objNull]] call BIS_fnc_param; - _container = [_args, 1, objNull, [objNull]] call BIS_fnc_param; + _args params [["_object", objNull, [objNull]], ["_container", objNull, [objNull]]]; _objectID = [_logic,"id",_object] call ALiVE_fnc_logistics; _containerID = [_logic,"id",_container] call ALiVE_fnc_logistics; @@ -385,10 +383,9 @@ switch (_operation) do { case "dropObject": { if (isnil "_args") exitwith {}; - private ["_object","_container","_objectID","_containerID"]; + private ["_objectID","_containerID"]; - _object = [_args, 0, objNull, [objNull]] call BIS_fnc_param; - _container = [_args, 1, objNull, [objNull]] call BIS_fnc_param; + _args params [["_object", objNull, [objNull]], ["_container", objNull, [objNull]]]; _objectID = [_logic,"id",_object] call ALiVE_fnc_logistics; _containerID = [_logic,"id",_container] call ALiVE_fnc_logistics; @@ -416,10 +413,9 @@ switch (_operation) do { [[_logic, _operation, _args],"ALIVE_fnc_logistics", false, false] call BIS_fnc_MP; }; - private ["_object","_container","_objectID","_containerID"]; + private ["_objectID","_containerID"]; - _object = [_args, 0, objNull, [objNull]] call BIS_fnc_param; - _container = [_args, 1, objNull, [objNull]] call BIS_fnc_param; + _args params [["_object", objNull, [objNull]], ["_container", objNull, [objNull]]]; _objectID = [_logic,"id",_object] call ALiVE_fnc_logistics; _containerID = [_logic,"id",_container] call ALiVE_fnc_logistics; @@ -441,10 +437,9 @@ switch (_operation) do { case "stowObjects": { if (isnil "_args") exitwith {}; - private ["_object","_container","_objectID","_containerID"]; + private ["_objectID","_containerID"]; - _object = [_args, 0, objNull, [objNull]] call BIS_fnc_param; - _container = [_args, 1, objNull, [objNull]] call BIS_fnc_param; + _args params [["_object", objNull, [objNull]], ["_container", objNull, [objNull]]]; _objectID = [_logic,"id",_object] call ALiVE_fnc_logistics; _containerID = [_logic,"id",_container] call ALiVE_fnc_logistics; @@ -462,10 +457,9 @@ switch (_operation) do { [[_logic, _operation, _args],"ALIVE_fnc_logistics", false, false] call BIS_fnc_MP; }; - private ["_object","_container","_objectID","_containerID"]; + private ["_objectID","_containerID"]; - _object = [_args, 0, objNull, [objNull]] call BIS_fnc_param; - _container = [_args, 1, objNull, [objNull]] call BIS_fnc_param; + _args params [["_object", objNull, [objNull]], ["_container", objNull, [objNull]]]; _objectID = [_logic,"id",_object] call ALiVE_fnc_logistics; _containerID = [_logic,"id",_container] call ALiVE_fnc_logistics; @@ -501,10 +495,9 @@ switch (_operation) do { case "unloadObjects": { if (isnil "_args") exitwith {}; - private ["_object","_container","_objectID","_containerID"]; + private ["_objectID","_containerID"]; - _object = [_args, 0, objNull, [objNull]] call BIS_fnc_param; - _container = [_args, 1, objNull, [objNull]] call BIS_fnc_param; + _args params [["_object", objNull, [objNull]], ["_container", objNull, [objNull]]]; // if (isNull _container) then {_container = _object}; @@ -519,10 +512,9 @@ switch (_operation) do { case "towObject": { if (isnil "_args") exitwith {}; - private ["_object","_container","_objectID","_containerID"]; + private ["_objectID","_containerID"]; - _object = [_args, 0, objNull, [objNull]] call BIS_fnc_param; - _container = [_args, 1, objNull, [objNull]] call BIS_fnc_param; + _args params [["_object", objNull, [objNull]], ["_container", objNull, [objNull]]]; _objectID = [_logic,"id",_object] call ALiVE_fnc_logistics; _containerID = [_logic,"id",_container] call ALiVE_fnc_logistics; @@ -546,10 +538,9 @@ switch (_operation) do { case "untowObject": { if (isnil "_args") exitwith {}; - private ["_object","_container","_objectID","_containerID"]; + private ["_objectID","_containerID"]; - _object = [_args, 0, objNull, [objNull]] call BIS_fnc_param; - _container = [_args, 1, objNull, [objNull]] call BIS_fnc_param; + _args params [["_object", objNull, [objNull]], ["_container", objNull, [objNull]]]; _objectID = [_logic,"id",_object] call ALiVE_fnc_logistics; _containerID = [_logic,"id",_container] call ALiVE_fnc_logistics; @@ -570,10 +561,9 @@ switch (_operation) do { case "liftObject": { if (isnil "_args") exitwith {}; - private ["_object","_container","_objectID","_containerID"]; + private ["_objectID","_containerID"]; - _object = [_args, 0, objNull, [objNull]] call BIS_fnc_param; - _container = [_args, 1, objNull, [objNull]] call BIS_fnc_param; + _args params [["_object", objNull, [objNull]], ["_container", objNull, [objNull]]]; _objectID = [_logic,"id",_object] call ALiVE_fnc_logistics; _containerID = [_logic,"id",_container] call ALiVE_fnc_logistics; @@ -596,10 +586,9 @@ switch (_operation) do { case "releaseObject": { if (isnil "_args") exitwith {}; - private ["_object","_container","_objectID","_containerID"]; + private ["_objectID","_containerID"]; - _object = [_args, 0, objNull, [objNull]] call BIS_fnc_param; - _container = [_args, 1, objNull, [objNull]] call BIS_fnc_param; + _args params [["_object", objNull, [objNull]], ["_container", objNull, [objNull]]]; _objectID = [_logic,"id",_object] call ALiVE_fnc_logistics; _containerID = [_logic,"id",_container] call ALiVE_fnc_logistics; @@ -625,10 +614,9 @@ switch (_operation) do { [[_logic, _operation, _args],"ALIVE_fnc_logistics", false, false] call BIS_fnc_MP; }; - private ["_container","_containerID","_list"]; + private ["_containerID"]; - _container = [_args, 0, objNull, [objNull]] call BIS_fnc_param; - _list = [_args, 1, [], [[]]] call BIS_fnc_param; + _args params [["_container", objNull, [objNull]], ["_list", [], [[]]]]; if (count _list == 0) exitwith {}; @@ -663,7 +651,7 @@ switch (_operation) do { private ["_container","_containerID"]; - _container = [[_args], 0, objNull, [objNull]] call BIS_fnc_param; + _container = [_args] param [0, objNull, [objNull]]; _containerID = [_logic,"id",_container] call ALiVE_fnc_logistics; _list = _container getvariable [QGVAR(CARGO),[]]; @@ -680,10 +668,9 @@ switch (_operation) do { }; case "addAction": { - private ["_object","_operation","_id","_condition","_text","_input","_container","_die"]; + private ["_id","_condition","_text","_input","_container","_die"]; - _object = [_args, 0, objNull, [objNull,[]]] call BIS_fnc_param; - _operation = [_args, 1, "", [""]] call BIS_fnc_param; + _args params [["_object", objNull, [objNull]], ["_operation", "", [""]]]; switch (typename _object) do { case ("ARRAY") : {_object = _object select 0}; @@ -780,10 +767,8 @@ switch (_operation) do { case "removeAction": { if (isnil "_args") exitwith {}; - private ["_object","_operation","_id"]; - - _object = [_args, 0, objNull, [objNull,[]]] call BIS_fnc_param; - _operation = [_args, 1, "", [""]] call BIS_fnc_param; + private ["_id"]; + _args params [["_object", objNull, [objNull]], ["_operation", "", [""]]]; _id = _object getvariable [format["ALiVE_SYS_LOGISTICS_%1",_operation],-1]; _object setvariable [format["ALiVE_SYS_LOGISTICS_%1",_operation],nil]; @@ -799,8 +784,7 @@ switch (_operation) do { }; case "removeActions": { - - _args = [_this, 2, player, [objNull]] call BIS_fnc_param; + _args = param [2, player, [objNull]]; if !(hasInterface) exitwith { [[_logic, _operation, _args],"ALIVE_fnc_logistics", owner _args, false] call BIS_fnc_MP; @@ -925,11 +909,9 @@ switch (_operation) do { case "allObjects" : { if (isnil "_args" || {isnull _args}) then {_args = []}; - private ["_position","_radius","_list","_objects"]; - - _position = [_args, 0, getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition")] call BIS_fnc_param; - _radius = [_args, 1, 30000] call BIS_fnc_param; - _list = [_args, 2, ["Reammobox_F","Static","ThingX","LandVehicle","Air"]] call BIS_fnc_param; + private ["_objects"]; + + _args params [["_position", getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition")], ["_radius", 30000], ["_list", ["Reammobox_F","Static","ThingX","LandVehicle","Air"]]]; _objects = []; { diff --git a/addons/sys_logistics/fnc_setObjectCargo.sqf b/addons/sys_logistics/fnc_setObjectCargo.sqf index 334f74497..13ed22f1d 100644 --- a/addons/sys_logistics/fnc_setObjectCargo.sqf +++ b/addons/sys_logistics/fnc_setObjectCargo.sqf @@ -26,16 +26,16 @@ Highhead Peer Reviewed: nil ---------------------------------------------------------------------------- */ +params[["_input", objNull, [objNull]]]; -private ["_input","_id","_cargo","_cargoR","_cargoT","_cargoL","_cargoWMI","_cargoW","_cargoM","_cargoI","_typesLogistics","_typesWeapons", "_acreActive", "_baseRadio"]; +private ["_id","_cargo","_cargoR","_cargoT","_cargoL","_cargoWMI","_cargoW","_cargoM","_cargoI","_typesLogistics","_typesWeapons", "_acreActive", "_baseRadio"]; -_input = [_this, 0, objNull, [objNull]] call BIS_fnc_param; _id = [MOD(SYS_LOGISTICS),"id",_input] call ALiVE_fnc_Logistics; _acreActive = isClass(configFile >> "CfgPatches" >> "acre_main"); if (count _this > 1) then { - _cargo = [_this, 1, [], [[]]] call BIS_fnc_param; + _cargo = param [1, [], [[]]] //["Using provided cargo set for %1: %2!",_input, _cargo] call ALiVE_fnc_DumpR; } else { _cargo = [[GVAR(STORE),_id] call ALiVE_fnc_HashGet,QGVAR(CARGO)] call ALiVE_fnc_HashGet; @@ -43,15 +43,9 @@ if (count _this > 1) then { }; // Provided Data -_cargoR = [_cargo, 0, [], [[]]] call BIS_fnc_param; -_cargoT = [_cargo, 1, [], [[]]] call BIS_fnc_param; -_cargoL = [_cargo, 2, [], [[]]] call BIS_fnc_param; -_cargoWMI = [_cargo, 3, [], [[]]] call BIS_fnc_param; -_Ammo = [_cargo, 4, [], [[]]] call BIS_fnc_param; - -_cargoW = [_cargoWMI, 0, [], [[]]] call BIS_fnc_param; -_cargoM = [_cargoWMI, 1, [], [[]]] call BIS_fnc_param; -_cargoI = [_cargoWMI, 2, [], [[]]] call BIS_fnc_param; +_cargo params [["_cargoR", [], [[]]], ["_cargoT", [], [[]]], ["_cargoL", [], [[]]], ["_cargoWMI", [], [[]]], ["_Ammo", [], [[]]]]; +_cargoWMI params [["_cargoW", [], [[]]], ["_cargoM", [], [[]]], ["_cargoI", [], [[]]]]; + // Detect local/global commands private _global = isMultiplayer && isServer; diff --git a/addons/sys_logistics/fnc_setObjectDamage.sqf b/addons/sys_logistics/fnc_setObjectDamage.sqf index 08d9bd46c..1598d6dd5 100644 --- a/addons/sys_logistics/fnc_setObjectDamage.sqf +++ b/addons/sys_logistics/fnc_setObjectDamage.sqf @@ -23,10 +23,7 @@ Peer Reviewed: nil ---------------------------------------------------------------------------- */ -private ["_object","_damage"]; - -_object = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -_damage = [_this, 1, -1, [-1]] call BIS_fnc_param; +params[["_object", objNull, [objNull]], ["_damage", -1, [-1]]]; if (isNull _object) exitwith {}; diff --git a/addons/sys_logistics/fnc_setObjectFuel.sqf b/addons/sys_logistics/fnc_setObjectFuel.sqf index 6fcaeebd9..0141eb3f7 100644 --- a/addons/sys_logistics/fnc_setObjectFuel.sqf +++ b/addons/sys_logistics/fnc_setObjectFuel.sqf @@ -2,10 +2,10 @@ SCRIPT(getObjectFuel); /* ---------------------------------------------------------------------------- -Function: ALIVE_fnc_getObjectFuel +Function: ALIVE_fnc_setObjectFuel Description: -Gets fuel state of the given object. +Sets fuel state of the given object. Parameters: _this: ARRAY of OBJECTs @@ -22,11 +22,7 @@ Highhead Peer Reviewed: nil ---------------------------------------------------------------------------- */ - -private ["_object","_fuel"]; - -_object = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -_fuel = [_this, 1, -1, [-1]] call BIS_fnc_param; +params[["_object", objNull, [objNull]], ["_fuel", -1, [-1]]]; if (isNull _object) exitwith {}; From 2b79ce862adcf2617cc2ae791d32f15347d9d26a Mon Sep 17 00:00:00 2001 From: trapw0w <28637553+trapw0w@users.noreply.github.com> Date: Sat, 6 Jun 2020 12:59:57 +1000 Subject: [PATCH 2/3] Cleanup --- addons/sys_logistics/fnc_getObjectCargo.sqf | 1 - addons/sys_logistics/fnc_logistics.sqf | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/sys_logistics/fnc_getObjectCargo.sqf b/addons/sys_logistics/fnc_getObjectCargo.sqf index c6617cec9..ca8d7607e 100644 --- a/addons/sys_logistics/fnc_getObjectCargo.sqf +++ b/addons/sys_logistics/fnc_getObjectCargo.sqf @@ -31,7 +31,6 @@ params[["_object", objNull, [objNull]]]; _weapons = [getWeaponCargo _object] param [0, [], [[]]]; _magazines = [getMagazineCargo _object] param [0, [], [[]]]; _items = [getItemCargo _object] param [0, [], [[]]]; - _ammo = [if ({_object isKindOf _x} count ["ReammoBox","ReammoBox_F"] == 0) then {magazinesAmmo _object} else {[]}] param [0, [], [[]]]; // Thank you BIS, magazinesAmmo _box returns different resultset than magazinesAmmo _car. Applause! private ["_cargo"]; diff --git a/addons/sys_logistics/fnc_logistics.sqf b/addons/sys_logistics/fnc_logistics.sqf index da04924de..a89f9f042 100644 --- a/addons/sys_logistics/fnc_logistics.sqf +++ b/addons/sys_logistics/fnc_logistics.sqf @@ -317,7 +317,7 @@ switch (_operation) do { [[_logic, _operation, _args],"ALIVE_fnc_logistics", false, false] call BIS_fnc_MP; }; - private ["_id"]; + private ["_id","_object"]; _object = _args param [0, objNull, [objNull, ""]]; switch (typeName _object) do { From c2f1d4f7a6900fdc80baf80f7a05753a26bd44b1 Mon Sep 17 00:00:00 2001 From: trapw0w <28637553+trapw0w@users.noreply.github.com> Date: Thu, 11 Jun 2020 21:51:56 +1000 Subject: [PATCH 3/3] Replace BIS_fnc_param Replacement of BIS_fnc_param with param/params for the following modules: - mil_c2istar - mil_command - mil_ied - mil_opcom - mil_placement - sup_combatsupport - sup_group_manager - sup_multispawn - sup_player_resupply - sys_adminactions - sys_data - sys_gc - sys_indexer - sys_marker - sys_newsfeed - sys_player - sys_tour - sys_xstream - x_lib --- .../tasks/fnc_taskDestroyBuilding.sqf | 20 ++++--------- addons/mil_c2istar/tasks/fnc_taskOCA.sqf | 20 +++---------- addons/mil_command/fnc_ambush.sqf | 2 +- addons/mil_command/fnc_commandRouter.sqf | 7 ++--- addons/mil_command/fnc_garrison.sqf | 8 ++---- addons/mil_command/fnc_insurgents.sqf | 5 ++-- addons/mil_ied/fnc_IED.sqf | 4 +-- addons/mil_opcom/fnc_OPCOM.sqf | 11 ++------ addons/mil_placement/fnc_MP.sqf | 4 +-- addons/sup_combatsupport/fnc_packMortar.sqf | 16 +++++------ addons/sup_combatsupport/fnc_unpackMortar.sqf | 10 +++---- .../functions/misc/fn_setGroupID.sqf | 4 +-- addons/sup_group_manager/fnc_GM.sqf | 7 ++--- addons/sup_group_manager/fnc_groupHandler.sqf | 7 ++--- .../fnc_establishingShotCustom.sqf | 12 ++------ addons/sup_multispawn/fnc_multispawn.sqf | 28 ++++++++----------- addons/sup_player_resupply/fnc_PR.sqf | 7 ++--- addons/sys_adminactions/fnc_adminActions.sqf | 7 ++--- .../fnc_adminActionsTeleportUnits.sqf | 4 +-- addons/sys_data/fnc_Data.sqf | 7 ++--- addons/sys_gc/fnc_GC.sqf | 7 ++--- addons/sys_indexer/fnc_indexer.sqf | 7 ++--- addons/sys_marker/fnc_marker.sqf | 7 ++--- addons/sys_newsfeed/fnc_newsFeed.sqf | 7 ++--- addons/sys_player/fnc_getGear.sqf | 5 ++-- addons/sys_player/fnc_getPlayer.sqf | 5 ++-- addons/sys_player/fnc_player.sqf | 6 ++-- addons/sys_player/fnc_setGear.sqf | 5 ++-- addons/sys_player/fnc_setPlayer.sqf | 5 ++-- addons/sys_player/fnc_vehicleInit.sqf | 4 +-- addons/sys_tour/fnc_tour.sqf | 7 ++--- addons/sys_xstream/fnc_camera.sqf | 4 +-- addons/sys_xstream/fnc_xStream.sqf | 7 ++--- .../x_lib/functions/data/fnc_unorderedMap.sqf | 4 +-- 34 files changed, 98 insertions(+), 172 deletions(-) diff --git a/addons/mil_c2istar/tasks/fnc_taskDestroyBuilding.sqf b/addons/mil_c2istar/tasks/fnc_taskDestroyBuilding.sqf index 813dc32bf..68429af0b 100644 --- a/addons/mil_c2istar/tasks/fnc_taskDestroyBuilding.sqf +++ b/addons/mil_c2istar/tasks/fnc_taskDestroyBuilding.sqf @@ -33,21 +33,11 @@ _result = []; switch (_taskState) do { case "init":{ - private ["_startTime","_taskEnemySide","_targetSector","_targetEntity","_taskPlayers","_targetTypes","_blacklist"]; - - private _taskID = [_task, 0, "", [""]] call BIS_fnc_param; - private _requestPlayerID = [_task, 1, "", [""]] call BIS_fnc_param; - private _taskSide = [_task, 2, "", [""]] call BIS_fnc_param; - private _taskFaction = [_task, 3, "", [""]] call BIS_fnc_param; - private _taskType = [_task, 4, "", [""]] call BIS_fnc_param; - private _taskLocationType = [_task, 5, "", [""]] call BIS_fnc_param; - private _taskLocation = [_task, 6, [], [[]]] call BIS_fnc_param; - private _taskPlayers = [_task, 7, [], [[]]] call BIS_fnc_param; - private _taskEnemyFaction = [_task, 8, "", [""]] call BIS_fnc_param; - private _taskCurrent = [_task, 9, "", [""]] call BIS_fnc_param; - private _taskApplyType = [_task, 10, "", [""]] call BIS_fnc_param; - private _targetBuildings = [_task, 11, [], [objnull,[]]] call BIS_fnc_param; - private _tasksCurrent = ([ALiVE_TaskHandler,"tasks",["",[],[],nil]] call ALiVE_fnc_HashGet) select 2; + private ["_startTime","_taskEnemySide","_targetSector","_targetEntity","_taskPlayers","_targetTypes","_blacklist", "_taskCurrent"]; + + _task params [["_taskID", "", [""]], ["_requestPlayerID", "", [""]], ["_taskSide", "", [""]], ["_taskFaction", "", [""]], ["_taskType", "", [""]], ["_taskLocationType", "", [""]], + ["_taskLocation", [], [[]]], ["_taskPlayers", [], [[]]], ["_taskEnemyFaction", "", [""]], ["_taskCurrent", "", [""]], ["_taskApplyType", "", [""]], ["_targetBuildings", [], [objNull,[]]] + ]; private _targetBuilding = switch (typeName _targetBuildings) do { case ("ARRAY") : { diff --git a/addons/mil_c2istar/tasks/fnc_taskOCA.sqf b/addons/mil_c2istar/tasks/fnc_taskOCA.sqf index b784d63d6..31722cf43 100644 --- a/addons/mil_c2istar/tasks/fnc_taskOCA.sqf +++ b/addons/mil_c2istar/tasks/fnc_taskOCA.sqf @@ -32,23 +32,11 @@ _result = []; switch (_taskState) do { case "init":{ - private [ - "_taskID","_requestPlayerID","_taskSide","_taskFaction","_taskLocationType","_taskLocation","_taskEnemyFaction","_taskCurrent", - "_taskApplyType","_startTime","_taskEnemySide","_targetSector","_targetEntity","_taskPlayers","_targetBuilding","_targetBuildings", - "_targetTypes","_blacklist","_tasksCurrent" - ]; + private ["_startTime","_taskEnemySide","_targetSector","_targetEntity","_targetBuilding","_targetTypes","_blacklist","_tasksCurrent"]; - _taskID = [_task, 0, "", [""]] call BIS_fnc_param; - _requestPlayerID = [_task, 1, "", [""]] call BIS_fnc_param; - _taskSide = [_task, 2, "", [""]] call BIS_fnc_param; - _taskFaction = [_task, 3, "", [""]] call BIS_fnc_param; - _taskLocationType = [_task, 5, "", [""]] call BIS_fnc_param; - _taskLocation = [_task, 6, [], [[]]] call BIS_fnc_param; - _taskPlayers = [_task, 7, [], [[]]] call BIS_fnc_param; - _taskEnemyFaction = [_task, 8, "", [""]] call BIS_fnc_param; - _taskCurrent = [_taskData, 9, "", [""]] call BIS_fnc_param; - _taskApplyType = [_taskData, 10, "", [""]] call BIS_fnc_param; - _targetBuildings = [_taskData, 11, [], [objnull]] call BIS_fnc_param; + _task params [["_taskID", "", [""]], ["_requestPlayerID", "", [""]], ["_taskSide", "", [""]], ["_taskFaction", "", [""]], "", ["_taskLocationType", "", [""]], + ["_taskLocation", "", [""]], ["_taskPlayers", [], [[]]], ["_taskEnemyFaction", "", [""]], ["_taskCurrent", "", [""]], ["_taskApplyType", "", [""]], ["_taskBuildings", [], [objNull]] + ]; _tasksCurrent = ([ALiVE_TaskHandler,"tasks",["",[],[],nil]] call ALiVE_fnc_HashGet) select 2; diff --git a/addons/mil_command/fnc_ambush.sqf b/addons/mil_command/fnc_ambush.sqf index 9834fd1e1..3b29c9e4a 100644 --- a/addons/mil_command/fnc_ambush.sqf +++ b/addons/mil_command/fnc_ambush.sqf @@ -29,7 +29,7 @@ params [ ["_params", [], [[]]] ]; -private _destination = [_params, 2, [0,0,0], [[]]] call BIS_fnc_param; +private _destination = _params param [2, [0,0,0], [[]]]; if (isnil "_profile") exitwith {}; diff --git a/addons/mil_command/fnc_commandRouter.sqf b/addons/mil_command/fnc_commandRouter.sqf index d4266d9e0..e3051e8cc 100644 --- a/addons/mil_command/fnc_commandRouter.sqf +++ b/addons/mil_command/fnc_commandRouter.sqf @@ -37,13 +37,10 @@ nil #define SUPERCLASS ALIVE_fnc_baseClassHash #define MAINCLASS ALIVE_fnc_commandRouter -private ["_logic","_operation","_args","_result"]; +private ["_result"]; +params [["_logic", objNull, [objNull,[]]], ["_operation", "", [""]], ["_args", objNull, [objNull,[],"",0,true,false]]]; TRACE_1("commandRouter - input",_this); - -_logic = [_this, 0, objNull, [objNull,[]]] call BIS_fnc_param; -_operation = [_this, 1, "", [""]] call BIS_fnc_param; -_args = [_this, 2, objNull, [objNull,[],"",0,true,false]] call BIS_fnc_param; _result = true; #define MTEMPLATE "ALiVE_COMMAND_ROUTER_%1" diff --git a/addons/mil_command/fnc_garrison.sqf b/addons/mil_command/fnc_garrison.sqf index b2f019435..32b993e04 100644 --- a/addons/mil_command/fnc_garrison.sqf +++ b/addons/mil_command/fnc_garrison.sqf @@ -24,16 +24,14 @@ Author: Highhead ---------------------------------------------------------------------------- */ -private ["_type","_waypoints","_unit","_profile","_active","_args","_pos","_radius","_onlyProfiles","_assignments","_group"]; - -_profile = [_this, 0, ["",[],[],nil], [[]]] call BIS_fnc_param; -_args = [_this, 1, 200, [-1,[]]] call BIS_fnc_param; +private ["_type","_waypoints","_unit","_active","_pos","_radius","_onlyProfiles","_assignments","_group"]; +params [["_profile", ["",[],[],nil], [[]]], ["_args", 200, [-1,[]]]]; _radius = _args; _onlyProfiles = false; if (_args isEqualType []) then { - _radius = [_args, 0, 200, [-1]] call BIS_fnc_param; + _radius = _args param [0, 200, [-1]]; _onlyProfiles = (_args param [1, "false", [""]]) == "true"; }; diff --git a/addons/mil_command/fnc_insurgents.sqf b/addons/mil_command/fnc_insurgents.sqf index 6e5a7daea..fa0ee347d 100644 --- a/addons/mil_command/fnc_insurgents.sqf +++ b/addons/mil_command/fnc_insurgents.sqf @@ -24,9 +24,8 @@ Author: Highhead ---------------------------------------------------------------------------- */ -private _profile = [_this, 0, ["",[],[],nil], [[]]] call BIS_fnc_param; -private _params = [_this, 1, [], [[]]] call BIS_fnc_param; -private _sidesEnemy = [_params, 0, ["WEST"], [[]]] call BIS_fnc_param; +params [["_profile", ["",[],[],nil], [[]]], ["_params", [], [[]]]]; +private _sidesEnemy = _params param [0, ["WEST"], [[]]]; _sidesEnemy = +_sidesEnemy; diff --git a/addons/mil_ied/fnc_IED.sqf b/addons/mil_ied/fnc_IED.sqf index fe246ea3b..01f74afbd 100644 --- a/addons/mil_ied/fnc_IED.sqf +++ b/addons/mil_ied/fnc_IED.sqf @@ -71,12 +71,10 @@ DEFAULT_CLUTTER [Land_Misc_Rubble_EP1","Land_Misc_Garb_Heap_EP1","Garbage_contai #define DEFAULT_CLUTTER ["Land_JunkPile_F","Land_GarbageContainer_closed_F","Land_GarbageBags_F","Land_Tyres_F","Land_GarbagePallet_F","Land_Basket_F","Land_Sack_F","Land_Sacks_goods_F","Land_Sacks_heap_F","Land_BarrelTrash_F"] private ["_logic","_operation","_args","_result"]; +params [["_logic", objNull, [objNull]], ["_operation", "", [""]], ["_args", objNull, [objNull,[],"",0,true,false]]]; TRACE_1("IED - input",_this); -_logic = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -_operation = [_this, 1, "", [""]] call BIS_fnc_param; -_args = [_this, 2, objNull, [objNull,[],"",0,true,false]] call BIS_fnc_param; _result = true; switch(_operation) do { diff --git a/addons/mil_opcom/fnc_OPCOM.sqf b/addons/mil_opcom/fnc_OPCOM.sqf index b0f242173..125b419d8 100644 --- a/addons/mil_opcom/fnc_OPCOM.sqf +++ b/addons/mil_opcom/fnc_OPCOM.sqf @@ -1980,14 +1980,9 @@ switch(_operation) do { _debug = [_logic, "debug",false] call ALIVE_fnc_HashGet; _side = [_logic, "side","EAST"] call ALIVE_fnc_HashGet; - _id = [_args, 0, "", [""]] call BIS_fnc_param; - _pos = [_args, 1, [0,0,0], [[]]] call BIS_fnc_param; - _size = [_args, 2, 50, [-1]] call BIS_fnc_param; - _type = [_args, 3, "unknown", [""]] call BIS_fnc_param; - _priority = [_args, 4, 100, [-1]] call BIS_fnc_param; - _opcom_state = [_args, 5, "unassigned", [""]] call BIS_fnc_param; - _clusterID = [_args, 6, "none", [""]] call BIS_fnc_param; - _opcomID = [_args, 7, [_logic,"opcomID",""] call ALiVE_fnc_HashGet, [""]] call BIS_fnc_param; + _args params [["_id", "", [""]], ["_pos", [0,0,0], [[]]], ["_size", 50, [-1]], ["_type", "unknown", [""]], ["_priority", 100, [-1]], + ["_opcom_state", "unassigned", [""]], ["_clusterID", "none", [""]], ["_opcomID", [_logic,"opcomID",""] call ALiVE_fnc_HashGet, [""]] + ]; _target = [nil, "createhashobject"] call ALIVE_fnc_OPCOM; [_target, "objectiveID",_id] call ALIVE_fnc_HashSet; diff --git a/addons/mil_placement/fnc_MP.sqf b/addons/mil_placement/fnc_MP.sqf index 69b6db0fe..6304b8f3a 100644 --- a/addons/mil_placement/fnc_MP.sqf +++ b/addons/mil_placement/fnc_MP.sqf @@ -62,9 +62,7 @@ private ["_logic","_operation","_args","_result"]; TRACE_1("MP - input",_this); -_logic = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -_operation = [_this, 1, "", [""]] call BIS_fnc_param; -_args = [_this, 2, objNull, [objNull,[],"",0,true,false]] call BIS_fnc_param; +params [["_logic", objNull, [objNull]], ["_operation", "", [""]], ["_args", objNull, [objNull,[],"",0,true,false]]]; _result = true; switch(_operation) do { diff --git a/addons/sup_combatsupport/fnc_packMortar.sqf b/addons/sup_combatsupport/fnc_packMortar.sqf index 2c93d5b48..a0c68bd77 100644 --- a/addons/sup_combatsupport/fnc_packMortar.sqf +++ b/addons/sup_combatsupport/fnc_packMortar.sqf @@ -14,16 +14,16 @@ SCRIPT(packMortar); _this select 0: the support team group (group) _this select 1: the weapon (option if weapon registered as "supportWeaponSetup" variable) */ -private["_group","_weapon","_position","_leader","_units","_gunner","_assistant","_type","_wait"]; +private["_position","_leader","_units","_gunner","_assistant","_type","_wait"]; -_group = [_this, 0, grpNull] call bis_fnc_param; -_weapon = [_this, 1, grpNull] call bis_fnc_param; -_type = typeOf _weapon; +params [["_group", grpNull], ["_weapon", grpNull]]; + +_type = typeOf _weapon; _position = position _weapon; -_leader = leader _group; -_gunner = gunner _weapon; -_units = (units _group) - [_leader]; -_units = _units - [_gunner]; +_leader = leader _group; +_gunner = gunner _weapon; +_units = (units _group) - [_leader]; +_units = _units - [_gunner]; if (_weapon == objNull || isNil "_weapon" || _group == grpNull || _leader == objNull) exitWith {}; diff --git a/addons/sup_combatsupport/fnc_unpackMortar.sqf b/addons/sup_combatsupport/fnc_unpackMortar.sqf index ee7631fa2..0219da8d5 100644 --- a/addons/sup_combatsupport/fnc_unpackMortar.sqf +++ b/addons/sup_combatsupport/fnc_unpackMortar.sqf @@ -15,15 +15,13 @@ SCRIPT(unpackMortar); _this select 1: location to place gun (position) _this select 2: location of target (position) */ -private ["_group","_position","_targetPos","_leader","_units","_gunner","_assistant","_weapon"]; +private ["_leader","_units","_gunner","_assistant"]; //diag_log str(_this); -_group = [_this, 0, grpNull] call bis_fnc_param; -_position = [_this, 1, grpNull] call bis_fnc_param; -_targetPos = [_this, 2, grpNull] call bis_fnc_param; -_weapon = [_this, 3, grpNull] call bis_fnc_param; -_units = (units _group); +params [["_group", grpNull], ["_position", grpNull], ["_targetPos", grpNull], ["_weapon", grpNull]]; + +_units = (units _group); { if (vehicle _x != _x) then { diff --git a/addons/sup_combatsupport/scripts/NEO_radio/functions/misc/fn_setGroupID.sqf b/addons/sup_combatsupport/scripts/NEO_radio/functions/misc/fn_setGroupID.sqf index 95a2b5ff0..5a80fca14 100644 --- a/addons/sup_combatsupport/scripts/NEO_radio/functions/misc/fn_setGroupID.sqf +++ b/addons/sup_combatsupport/scripts/NEO_radio/functions/misc/fn_setGroupID.sqf @@ -3,10 +3,8 @@ // Example: [[group,groupID], "CP_fnc_setGroupID", false, false] spawn BIS_fnc_MP; // Params: //============================================================================================================================================================================== -private ["_group","_groupID"]; -_group = [_this, 0, grpNull, [grpNull,objNull]] call BIS_fnc_param; -_groupID = [_this, 1, "none", [""]] call BIS_fnc_param; +params [["_group", grpNull, [grpNull,objNull]], ["_groupID", "none", [""]]]; _group = if (typeName _group == "OBJECT") then {group _group} else {_group}; diff --git a/addons/sup_group_manager/fnc_GM.sqf b/addons/sup_group_manager/fnc_GM.sqf index 2ad9d9c7a..c9b5a4555 100644 --- a/addons/sup_group_manager/fnc_GM.sqf +++ b/addons/sup_group_manager/fnc_GM.sqf @@ -71,13 +71,12 @@ Peer Reviewed: #define GM_getSelData(ctrl) (lbData[##ctrl,(lbCurSel ##ctrl)]) -private ["_logic","_operation","_args","_result"]; +private ["_result"]; + +params [["_logic", objNull, [objNull]], ["_operation", "", [""]], ["_args", objNull, [objNull,[],"",0,true,false]]]; TRACE_1("GM - input",_this); -_logic = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -_operation = [_this, 1, "", [""]] call BIS_fnc_param; -_args = [_this, 2, objNull, [objNull,[],"",0,true,false]] call BIS_fnc_param; _result = true; switch(_operation) do { diff --git a/addons/sup_group_manager/fnc_groupHandler.sqf b/addons/sup_group_manager/fnc_groupHandler.sqf index 7e3abf6e6..3043df1ba 100644 --- a/addons/sup_group_manager/fnc_groupHandler.sqf +++ b/addons/sup_group_manager/fnc_groupHandler.sqf @@ -39,13 +39,12 @@ nil #define SUPERCLASS ALIVE_fnc_baseClassHash #define MAINCLASS ALIVE_fnc_groupHandler -private ["_logic","_operation","_args","_result"]; +private ["_result"]; + +params [["_logic", objNull, [objNull,[]]], ["_operation", "", [""]], ["_args", objNull, [objNull,[],"",0,true,false]]]; TRACE_1("groupHandler - input",_this); -_logic = [_this, 0, objNull, [objNull,[]]] call BIS_fnc_param; -_operation = [_this, 1, "", [""]] call BIS_fnc_param; -_args = [_this, 2, objNull, [objNull,[],"",0,true,false]] call BIS_fnc_param; //_result = true; #define MTEMPLATE "ALiVE_GROUPHANDLER_%1" diff --git a/addons/sup_multispawn/fnc_establishingShotCustom.sqf b/addons/sup_multispawn/fnc_establishingShotCustom.sqf index 54a5edb5f..1e2126422 100644 --- a/addons/sup_multispawn/fnc_establishingShotCustom.sqf +++ b/addons/sup_multispawn/fnc_establishingShotCustom.sqf @@ -37,19 +37,11 @@ Peer reviewed: nil ---------------------------------------------------------------------------- */ -private ["_tgt", "_txt", "_alt", "_rad", "_ang", "_dir"]; +params [["_tgt", objNull, [objNull, []]], ["_txt", "", [""]], ["_alt", 500, [500]], ["_rad", 200, [200]], ["_ang", random 360, [0]], ["_dir", round random 1, [0]], ["_condition", [[],{true}], [[]]]]; if !(hasInterface) exitwith {}; -_tgt = [_this, 0, objNull, [objNull, []]] call BIS_fnc_param; -_txt = [_this, 1, "", [""]] call BIS_fnc_param; -_alt = [_this, 2, 500, [500]] call BIS_fnc_param; -_rad = [_this, 3, 200, [200]] call BIS_fnc_param; -_ang = [_this, 4, random 360, [0]] call BIS_fnc_param; -_dir = [_this, 5, round random 1, [0]] call BIS_fnc_param; -_condition = [_this, 8, [[],{true}], [[]]] call BIS_fnc_param; - -ALiVE_fnc_establishingShot_icons = [_this, 6, [], [[]]] call BIS_fnc_param; +ALiVE_fnc_establishingShot_icons = _this param [6, [], [[]]]; private ["_mode"]; diff --git a/addons/sup_multispawn/fnc_multispawn.sqf b/addons/sup_multispawn/fnc_multispawn.sqf index a7defb6f3..ed73e7e4d 100644 --- a/addons/sup_multispawn/fnc_multispawn.sqf +++ b/addons/sup_multispawn/fnc_multispawn.sqf @@ -430,9 +430,9 @@ switch(_operation) do { case "loader": { if !(isServer) exitwith {}; - private ["_player","_transport","_timer"]; - - _player = [[_args], 0, objNull, [objNull]] call BIS_fnc_param; + private ["_transport","_timer"]; + + [_args] params [["_player", objNull, [objNull]]]; _factionData = [GVAR(STORE),faction _player] call ALiVE_fnc_HashGet; [[_logic,"disablePlayer",_player], "ALiVE_fnc_MultiSpawn", owner _player, false] call BIS_fnc_MP; @@ -466,9 +466,7 @@ switch(_operation) do { case "enablePlayer": { if !(hasInterface) exitwith {}; - private ["_player"]; - - _player = [[_args], 0, objNull, [objNull]] call BIS_fnc_param; + [_args] params [["_player", objNull, [objNull]]]; if !(player == _player) exitwith {}; @@ -481,9 +479,9 @@ switch(_operation) do { case "disablePlayer": { if !(hasInterface) exitwith {}; - private ["_player","_tgts"]; + private ["_tgts"]; - _player = [[_args], 0, objNull, [objNull]] call BIS_fnc_param; + [_args] params [["_player", objNull, [objNull]]]; if !(player == _player) exitwith {}; @@ -510,12 +508,8 @@ switch(_operation) do { case "insert": { if !(isServer) exitwith {}; - private ["_StartPos","_EndPos","_transport","_TransportType","_side","_queue","_faction"]; - - _startPos = [_args, 0, [0,0,100], [[]]] call BIS_fnc_param; - _endPos = [_args, 1, getMarkerpos "Respawn_West", [[]]] call BIS_fnc_param; - _faction = [_args, 2, "BLU_F", [""]] call BIS_fnc_param; - _timeOut = [_args, 3, 30, [-1]] call BIS_fnc_param; + private ["_transport","_TransportType","_side","_queue"]; + _args params [["_startPos", [0,0,100], [[]]], ["_endPos", getMarkerpos "Respawn_West", [[]]], ["_faction", "BLU_F", [""]], ["_timeOut"], 30, [-1]]; _time = time; if (isnil "_faction") exitwith {["ALiVE_SUP_MULTISPAWN - faction not found when checking queue! Exiting queue..."]}; @@ -665,9 +659,9 @@ switch(_operation) do { case "collect": { if !(isServer) exitwith {}; - private ["_player","_insertion","_destination","_transport","_timeout"]; - - _player = [[_args], 0, objNull, [objNull]] call BIS_fnc_param; + private ["_insertion","_destination","_transport","_timeout"]; + + [_args] params [["_player", objNull, [objNull]]]; _factionData = [GVAR(STORE),faction _player] call ALiVE_fnc_HashGet; _transport = [_factionData,QGVAR(INSERTION_TRANSPORT)] call ALiVE_fnc_HashGet; diff --git a/addons/sup_player_resupply/fnc_PR.sqf b/addons/sup_player_resupply/fnc_PR.sqf index 0083cdc78..e8c4ce1c0 100644 --- a/addons/sup_player_resupply/fnc_PR.sqf +++ b/addons/sup_player_resupply/fnc_PR.sqf @@ -94,13 +94,12 @@ Peer Reviewed: #define PR_getSelData(ctrl) (lbData[##ctrl,(lbCurSel ##ctrl)]) -private ["_logic","_operation","_args","_result"]; +private ["_result"]; TRACE_1("PR - input",_this); -_logic = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -_operation = [_this, 1, "", [""]] call BIS_fnc_param; -_args = [_this, 2, objNull, [objNull,[],"",0,true,false]] call BIS_fnc_param; +params [["_logic", objNull, [objNull]], ["_operation", "", [""]], ["_args", objNull, [objNull,[],"",0,true,false]]]; + _result = true; switch(_operation) do { diff --git a/addons/sys_adminactions/fnc_adminActions.sqf b/addons/sys_adminactions/fnc_adminActions.sqf index 81fa1e9e6..1dc413910 100644 --- a/addons/sys_adminactions/fnc_adminActions.sqf +++ b/addons/sys_adminactions/fnc_adminActions.sqf @@ -47,11 +47,10 @@ nil #define SUPERCLASS ALIVE_fnc_baseClass #define MAINCLASS ALIVE_fnc_adminActions -private ["_logic","_operation","_args","_result"]; +private ["_result"]; + +params [["_logic", objNull, [objNull]], ["_operation", "", [""]], ["_args", objNull, [objNull,[],"",0,true,false]]]; -_logic = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -_operation = [_this, 1, "", [""]] call BIS_fnc_param; -_args = [_this, 2, objNull, [objNull,[],"",0,true,false]] call BIS_fnc_param; _result = true; TRACE_3(QUOTE(ADDON),_logic, _operation, _args); diff --git a/addons/sys_adminactions/fnc_adminActionsTeleportUnits.sqf b/addons/sys_adminactions/fnc_adminActionsTeleportUnits.sqf index 42f66c0df..7d0822b8e 100644 --- a/addons/sys_adminactions/fnc_adminActionsTeleportUnits.sqf +++ b/addons/sys_adminactions/fnc_adminActionsTeleportUnits.sqf @@ -23,9 +23,9 @@ Peer Reviewed: nil ---------------------------------------------------------------------------- */ -private ["_unit","_input","_pos"]; +private ["_unit","_pos", "_input"]; -_input = [[_this], 0, ["CAManBase"], [[]]] call BIS_fnc_param; +_input = [_this] param [0, ["CAManBase"], [[]]]; _unit = objNull; [] call ALIVE_fnc_markUnits; diff --git a/addons/sys_data/fnc_Data.sqf b/addons/sys_data/fnc_Data.sqf index fb71919de..021b587ec 100644 --- a/addons/sys_data/fnc_Data.sqf +++ b/addons/sys_data/fnc_Data.sqf @@ -36,11 +36,10 @@ Tupolov #define SUPERCLASS ALIVE_fnc_baseClassHash #define MAINCLASS ALIVE_fnc_Data -private ["_result", "_operation", "_args", "_logic", "_ops"]; +private ["_result","_ops"]; + +params [["_logic", objNull, [objNull,[]]], ["_operation", "", [""]], ["_args", objNull, [objNull,[],"",0,true,false]]]; -_logic = [_this, 0, objNull, [objNull,[]]] call BIS_fnc_param; -_operation = [_this, 1, "", [""]] call BIS_fnc_param; -_args = [_this, 2, objNull, [objNull,[],"",0,true,false]] call BIS_fnc_param; private _sourceOverride = param [3, "", [""]]; //TRACE_3("SYS_DATA",_logic, _operation, _args); diff --git a/addons/sys_gc/fnc_GC.sqf b/addons/sys_gc/fnc_GC.sqf index 6f6cdccda..10b469db5 100644 --- a/addons/sys_gc/fnc_GC.sqf +++ b/addons/sys_gc/fnc_GC.sqf @@ -39,13 +39,12 @@ nil #define SUPERCLASS ALIVE_fnc_baseClassHash #define MAINCLASS ALIVE_fnc_GC -private ["_logic","_operation","_args","_result"]; +private ["_result"]; TRACE_1("GC - input",_this); -_logic = [_this, 0, objNull, [objNull,[]]] call BIS_fnc_param; -_operation = [_this, 1, "", [""]] call BIS_fnc_param; -_args = [_this, 2, objNull,[objNull,grpNull,[],"",0,true,false]] call BIS_fnc_param; +params [["_logic", objNull, [objNull,[]]], ["_operation", "", [""]], ["_args", objNull,[objNull,grpNull,[],"",0,true,false]]]; + _result = nil; #define MTEMPLATE "ALiVE_GC_%1" diff --git a/addons/sys_indexer/fnc_indexer.sqf b/addons/sys_indexer/fnc_indexer.sqf index ceb90d333..250d96058 100644 --- a/addons/sys_indexer/fnc_indexer.sqf +++ b/addons/sys_indexer/fnc_indexer.sqf @@ -39,11 +39,10 @@ Gunny #define SUPERCLASS ALIVE_fnc_baseClass #define MAINCLASS ALIVE_fnc_indexer -private ["_logic","_operation","_args","_result"]; +private ["_result"]; + +params [["_logic", objNull, [objNull]], ["_operation", "", [""]], ["_args", objNull, [objNull,[],"",0,true,false]]]; -_logic = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -_operation = [_this, 1, "", [""]] call BIS_fnc_param; -_args = [_this, 2, objNull, [objNull,[],"",0,true,false]] call BIS_fnc_param; _result = true; TRACE_3("SYS_indexer",_logic, _operation, _args); diff --git a/addons/sys_marker/fnc_marker.sqf b/addons/sys_marker/fnc_marker.sqf index 68d1b2e32..2c5798acd 100644 --- a/addons/sys_marker/fnc_marker.sqf +++ b/addons/sys_marker/fnc_marker.sqf @@ -99,12 +99,9 @@ nil #define SYS_MARKER_MAP_TEXT 5999 -private ["_result", "_operation", "_args", "_logic"]; - -_logic = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -_operation = [_this, 1, "", [""]] call BIS_fnc_param; -_args = [_this, 2, objNull, [objNull,[],"",0,true,false]] call BIS_fnc_param; +private ["_result"]; +params [["_logic", objNull, [objNull]], ["_operation", "", [""]], ["_args", objNull, [objNull,[],"",0,true,false]]]; TRACE_3("SYS_marker",_logic, _operation, _args); diff --git a/addons/sys_newsfeed/fnc_newsFeed.sqf b/addons/sys_newsfeed/fnc_newsFeed.sqf index 38fa7a015..de2b1285e 100644 --- a/addons/sys_newsfeed/fnc_newsFeed.sqf +++ b/addons/sys_newsfeed/fnc_newsFeed.sqf @@ -39,11 +39,10 @@ Gunny #define SUPERCLASS ALIVE_fnc_baseClass #define MAINCLASS ALIVE_fnc_newsFeed -private ["_logic","_operation","_args","_result"]; +private ["_result"]; + +params [["_logic", objNull, [objNull]], ["_operation", "", [""]], ["_args", objNull, [objNull,[],"",0,true,false]]]; -_logic = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -_operation = [_this, 1, "", [""]] call BIS_fnc_param; -_args = [_this, 2, objNull, [objNull,[],"",0,true,false]] call BIS_fnc_param; _result = true; TRACE_3("SYS_NEWSFEED",_logic, _operation, _args); diff --git a/addons/sys_player/fnc_getGear.sqf b/addons/sys_player/fnc_getGear.sqf index 025b85e2d..903a238df 100644 --- a/addons/sys_player/fnc_getGear.sqf +++ b/addons/sys_player/fnc_getGear.sqf @@ -29,10 +29,9 @@ Peer reviewed: nil ---------------------------------------------------------------------------- */ -private ["_logic","_args","_player","_find","_data","_gearHash","_result","_data"]; +private ["_player","_find","_data","_gearHash","_result","_data"]; -_logic = [_this, 0, objNull, [objNull,[]]] call BIS_fnc_param; -_args = [_this, 1, objNull, [objNull,[],"",0,true,false]] call BIS_fnc_param; +params [["_logic", objNull, [objNull,[]]], ["_args", objNull, [objNull,[],"",0,true,false]]]; _player = _args select 0; _gearHash = _args select 1; diff --git a/addons/sys_player/fnc_getPlayer.sqf b/addons/sys_player/fnc_getPlayer.sqf index 0bae32e4e..d322ee03b 100644 --- a/addons/sys_player/fnc_getPlayer.sqf +++ b/addons/sys_player/fnc_getPlayer.sqf @@ -29,10 +29,9 @@ Peer reviewed: nil ---------------------------------------------------------------------------- */ -private ["_logic","_args","_player","_find","_saveLoadout","_saveHealth","_savePosition","_saveScores","_data","_playerHash","_result","_data"]; +private ["_player","_find","_saveLoadout","_saveHealth","_savePosition","_saveScores","_data","_playerHash","_result","_data"]; -_logic = [_this, 0, objNull, [objNull,[]]] call BIS_fnc_param; -_args = [_this, 1, objNull, [objNull,[],"",0,true,false]] call BIS_fnc_param; +params [["_logic", objNull, [objNull,[]]], ["_args", objNull, [objNull,[],"",0,true,false]]]; _player = _args select 0; _playerHash = _args select 1; diff --git a/addons/sys_player/fnc_player.sqf b/addons/sys_player/fnc_player.sqf index c65653098..e4d510b85 100644 --- a/addons/sys_player/fnc_player.sqf +++ b/addons/sys_player/fnc_player.sqf @@ -52,11 +52,9 @@ nil #define DEFAULT_storeToDB false #define DEFAULT_autoSaveTime 0 -private ["_result", "_operation", "_args", "_logic", "_ops"]; +private ["_logic", "_ops"]; -_logic = [_this, 0, objNull, [objNull,[]]] call BIS_fnc_param; -_operation = [_this, 1, "", [""]] call BIS_fnc_param; -_args = [_this, 2, objNull, [objNull,[],"",0,true,false]] call BIS_fnc_param; +params [["_logic", objNull, [objNull,[]]], ["_operation", "", [""]], ["_args", objNull, [objNull,[],"",0,true,false]]]; TRACE_3(QUOTE(ADDON),_logic, _operation, _args); diff --git a/addons/sys_player/fnc_setGear.sqf b/addons/sys_player/fnc_setGear.sqf index 77197740c..5aa26ab93 100644 --- a/addons/sys_player/fnc_setGear.sqf +++ b/addons/sys_player/fnc_setGear.sqf @@ -29,10 +29,9 @@ Peer reviewed: nil ---------------------------------------------------------------------------- */ -private ["_logic","_args","_player","_find","_data","_gearHash","_result","_data"]; +private ["_player","_find","_data","_gearHash","_result","_data"]; -_logic = [_this, 0, objNull, [objNull,[]]] call BIS_fnc_param; -_args = [_this, 1, objNull, [objNull,[],"",0,true,false]] call BIS_fnc_param; +params [["_logic", objNull, [objNull,[]]], ["_args", objNull, [objNull,[],"",0,true,false]]]; _data = []; diff --git a/addons/sys_player/fnc_setPlayer.sqf b/addons/sys_player/fnc_setPlayer.sqf index 34466659f..d634cf314 100644 --- a/addons/sys_player/fnc_setPlayer.sqf +++ b/addons/sys_player/fnc_setPlayer.sqf @@ -29,10 +29,9 @@ Peer reviewed: nil ---------------------------------------------------------------------------- */ -private ["_logic","_args","_player","_find","_saveLoadout","_saveHealth","_savePosition","_saveScores","_data","_playerHash","_result","_data"]; +private ["_player","_find","_saveLoadout","_saveHealth","_savePosition","_saveScores","_data","_playerHash","_result","_data"]; -_logic = [_this, 0, objNull, [objNull,[]]] call BIS_fnc_param; -_args = [_this, 1, objNull, [objNull,[],"",0,true,false]] call BIS_fnc_param; +params [["_logic", objNull, [objNull,[]]], ["_args", objNull, [objNull,[],"",0,true,false]]]; _data = []; diff --git a/addons/sys_player/fnc_vehicleInit.sqf b/addons/sys_player/fnc_vehicleInit.sqf index 8cccea297..bba8597c6 100644 --- a/addons/sys_player/fnc_vehicleInit.sqf +++ b/addons/sys_player/fnc_vehicleInit.sqf @@ -28,9 +28,9 @@ Peer reviewed: nil ---------------------------------------------------------------------------- */ -private ["_vehicle","_vehicleID"]; +private ["_vehicleID"]; -_vehicle = [_this, 0, objNull, [objNull,[]]] call BIS_fnc_param; +params [["_vehicle", objNull, [objNull,[]]]]; if (isServer && !isHC) then { if (isNil QGVAR(VEHICLEID)) then { diff --git a/addons/sys_tour/fnc_tour.sqf b/addons/sys_tour/fnc_tour.sqf index 76df30cd8..be6a03665 100644 --- a/addons/sys_tour/fnc_tour.sqf +++ b/addons/sys_tour/fnc_tour.sqf @@ -37,13 +37,12 @@ Peer Reviewed: #define MAINCLASS ALIVE_fnc_tour #define MTEMPLATE "ALiVE_TOUR_%1" -private ["_logic","_operation","_args","_result","_debug"]; +private ["_result","_debug"]; + +params [["_logic", objNull, [objNull]], ["_operation", "", [""]], ["_args", objNull, [objNull,[],"",0,true,false]]]; TRACE_1("TOUR - input",_this); -_logic = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -_operation = [_this, 1, "", [""]] call BIS_fnc_param; -_args = [_this, 2, objNull, [objNull,[],"",0,true,false]] call BIS_fnc_param; _result = true; switch(_operation) do { diff --git a/addons/sys_xstream/fnc_camera.sqf b/addons/sys_xstream/fnc_camera.sqf index f8bd03806..33826fda5 100644 --- a/addons/sys_xstream/fnc_camera.sqf +++ b/addons/sys_xstream/fnc_camera.sqf @@ -2,9 +2,9 @@ #include "\x\alive\addons\sys_xstream\script_component.hpp" SCRIPT(camera); -private ["_relpos","_cam","_cameraTarget","_fov","_sceneChoice","_subChoice","_loopHandle","_logic"]; +private ["_relpos","_cam","_cameraTarget","_fov","_sceneChoice","_subChoice","_loopHandle"]; -_logic = [_this, 0, objNull, [objNull]] call BIS_fnc_param; +params [["_logic", objNull, [objNull]]]; // Setup params from logic ALiVE_VehicleFired = []; diff --git a/addons/sys_xstream/fnc_xStream.sqf b/addons/sys_xstream/fnc_xStream.sqf index 12aaa76fc..10256d055 100644 --- a/addons/sys_xstream/fnc_xStream.sqf +++ b/addons/sys_xstream/fnc_xStream.sqf @@ -52,13 +52,12 @@ Peer Reviewed: #define MTEMPLATE "ALiVE_XSTREAM_%1" -private ["_logic","_operation","_args","_result","_debug","_enableTwitch","_enableCamera","_enableLiveMap"]; +private ["_result","_debug","_enableTwitch","_enableCamera","_enableLiveMap"]; TRACE_1("XSTREAM - input",_this); -_logic = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -_operation = [_this, 1, "", [""]] call BIS_fnc_param; -_args = [_this, 2, objNull, [objNull,[],"",0,true,false]] call BIS_fnc_param; +params [["_logic", objNull, [objNull]], ["_operation", "", [""]], ["_args", objNull, [objNull,[],"",0,true,false]]]; + _result = true; switch(_operation) do { diff --git a/addons/x_lib/functions/data/fnc_unorderedMap.sqf b/addons/x_lib/functions/data/fnc_unorderedMap.sqf index 35b7ef847..6ea78694d 100644 --- a/addons/x_lib/functions/data/fnc_unorderedMap.sqf +++ b/addons/x_lib/functions/data/fnc_unorderedMap.sqf @@ -89,7 +89,7 @@ switch (_func) do case "at": // _args = "key" or ["key", default] { private ["_index"]; - _index = (_data select 1) find ([_args, 0, ""] call BIS_fnc_param); + _index = (_data select 1) find (_args param [0, ""]); if (_index >= 0) then { @@ -97,7 +97,7 @@ switch (_func) do } else { - [_args, 1, nil] call BIS_fnc_param; // Return default or nil on failure + _args param [1, nil]; // Return default or nil on failure }; };