From 727ac12e6cea33e23ecd5d01c2df01dffb53458a Mon Sep 17 00:00:00 2001 From: Drofseh Date: Mon, 8 Nov 2021 11:08:43 -0800 Subject: [PATCH] switch from params to select for single value returns when calling getWeaponData (#8672) --- addons/overheating/functions/fnc_coolWeaponWithItem.sqf | 2 +- addons/overheating/functions/fnc_coolWeaponWithWaterSource.sqf | 2 +- addons/overheating/functions/fnc_getBarrelMass.sqf | 2 +- addons/overheating/functions/fnc_swapBarrelCallback.sqf | 2 +- addons/overheating/functions/fnc_updateAmmoTemperature.sqf | 2 +- addons/overheating/functions/fnc_updateTemperature.sqf | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/overheating/functions/fnc_coolWeaponWithItem.sqf b/addons/overheating/functions/fnc_coolWeaponWithItem.sqf index 3a8091584b..d089c04a64 100644 --- a/addons/overheating/functions/fnc_coolWeaponWithItem.sqf +++ b/addons/overheating/functions/fnc_coolWeaponWithItem.sqf @@ -61,7 +61,7 @@ private _fnc_onSuccess = { }; // cool the weapon - ([_weapon] call FUNC(getWeaponData)) params ["", "", "", "", "", "", "", "_barrelMass"]; + private _barrelMass = ([_weapon] call FUNC(getWeaponData)) select 7; _temperature = [_temperature, _barrelMass, _liquidAmount * 10] call FUNC(calculateCooling); [_target, _tempVarName, _temperature, TEMP_TOLERANCE] call EFUNC(common,setApproximateVariablePublic); }; diff --git a/addons/overheating/functions/fnc_coolWeaponWithWaterSource.sqf b/addons/overheating/functions/fnc_coolWeaponWithWaterSource.sqf index 2ed62e02f3..5879ea6b6c 100644 --- a/addons/overheating/functions/fnc_coolWeaponWithWaterSource.sqf +++ b/addons/overheating/functions/fnc_coolWeaponWithWaterSource.sqf @@ -59,7 +59,7 @@ private _fnc_condition = { }; //Cool the weapon down - ([_weapon] call FUNC(getWeaponData)) params ["", "", "", "", "", "", "", "_barrelMass"]; + private _barrelMass = ([_weapon] call FUNC(getWeaponData)) select 7; _temperature = [_temperature, _barrelMass, 20] call FUNC(calculateCooling); [_player, _tempVarName, _temperature, TEMP_TOLERANCE] call EFUNC(common,setApproximateVariablePublic); diff --git a/addons/overheating/functions/fnc_getBarrelMass.sqf b/addons/overheating/functions/fnc_getBarrelMass.sqf index 3dab9cae89..a8eb9797ad 100644 --- a/addons/overheating/functions/fnc_getBarrelMass.sqf +++ b/addons/overheating/functions/fnc_getBarrelMass.sqf @@ -17,6 +17,6 @@ params ["_weapon"]; -([_weapon] call FUNC(getWeaponData)) params ["", "", "", "", "", "", "", "_barrelMass"]; +private _barrelMass = ([_weapon] call FUNC(getWeaponData)) select 7; _barrelMass diff --git a/addons/overheating/functions/fnc_swapBarrelCallback.sqf b/addons/overheating/functions/fnc_swapBarrelCallback.sqf index a418d35510..e385e09844 100644 --- a/addons/overheating/functions/fnc_swapBarrelCallback.sqf +++ b/addons/overheating/functions/fnc_swapBarrelCallback.sqf @@ -34,7 +34,7 @@ if (GVAR(unJamOnSwapBarrel) && {[_gunner] call FUNC(canUnjam)}) then { [localize LSTRING(SwappedBarrel), QPATHTOF(UI\spare_barrel_ca.paa)] call EFUNC(common,displayTextPicture); private _temp = _gunner getVariable [format [QGVAR(%1_temp), _weapon], 0]; -([_weapon] call FUNC(getWeaponData)) params ["", "", "", "", "", "", "", "_barrelMass"]; +private _barrelMass = ([_weapon] call FUNC(getWeaponData)) select 7; // Instruct the server to load the coolest spare barrel into the weapon and // store the removed barrel with the former weapon temperature. The server diff --git a/addons/overheating/functions/fnc_updateAmmoTemperature.sqf b/addons/overheating/functions/fnc_updateAmmoTemperature.sqf index fd1ac2880c..b612446b7b 100644 --- a/addons/overheating/functions/fnc_updateAmmoTemperature.sqf +++ b/addons/overheating/functions/fnc_updateAmmoTemperature.sqf @@ -20,7 +20,7 @@ params ["_unit", "_weapon", "_barrelTemperature"]; TRACE_3("params",_unit,_weapon,_barrelTemperature); -([_weapon] call FUNC(getWeaponData)) params ["", "", "", "", "", "", "_closedBolt"]; +private _closedBolt = ([_weapon] call FUNC(getWeaponData)) select 6; private _canUnjam = [_unit] call FUNC(canUnjam); private _jamType = _unit getVariable [format [QGVAR(%1_jamType), _weapon], "None"]; diff --git a/addons/overheating/functions/fnc_updateTemperature.sqf b/addons/overheating/functions/fnc_updateTemperature.sqf index e1368ea2e5..27d49cd2d1 100644 --- a/addons/overheating/functions/fnc_updateTemperature.sqf +++ b/addons/overheating/functions/fnc_updateTemperature.sqf @@ -33,7 +33,7 @@ _trackedWeapons pushBackUnique _tempVarName; _unit setVariable [QGVAR(trackedWeapons), _trackedWeapons]; // Calculate cooling -([_weapon] call FUNC(getWeaponData)) params ["", "", "", "", "", "", "", "_barrelMass"]; +private _barrelMass = ([_weapon] call FUNC(getWeaponData)) select 7; _temperature = [_temperature, _barrelMass, CBA_missionTime - _lastTime] call FUNC(calculateCooling); TRACE_1("cooledTo",_temperature);