From a0fdc58ed7fdae472e0716694783856344c9f7cd Mon Sep 17 00:00:00 2001 From: VKing Date: Thu, 17 Dec 2015 09:13:23 +0100 Subject: [PATCH] Remove unused variables, spaces --- addons/mk6mortar/cfgMagazines.hpp | 10 +++++----- addons/mk6mortar/config.cpp | 2 +- addons/mk6mortar/functions/fnc_canLoadMagazine.sqf | 5 ++--- addons/mk6mortar/functions/fnc_loadMagazine.sqf | 2 +- addons/mk6mortar/functions/fnc_loadMagazineTimer.sqf | 3 +-- addons/mk6mortar/functions/fnc_unloadMagazine.sqf | 5 +++-- addons/mk6mortar/functions/fnc_unloadMagazineTimer.sqf | 4 +--- 7 files changed, 14 insertions(+), 17 deletions(-) diff --git a/addons/mk6mortar/cfgMagazines.hpp b/addons/mk6mortar/cfgMagazines.hpp index 04ea05d624..90512541fc 100644 --- a/addons/mk6mortar/cfgMagazines.hpp +++ b/addons/mk6mortar/cfgMagazines.hpp @@ -8,7 +8,7 @@ class cfgMagazines { displayName = CSTRING(magazine_HE_displayName); descriptionShort = CSTRING(magazine_HE_descriptionShort); model = PATHTOF(data\l16_ammo_he.p3d) - picture = PATHTOF(UI\w_l16_ammo_he_ca.paa); + picture = PATHTOF(UI\w_l16_ammo_he_ca.paa); mass = 10; }; class 8Rnd_82mm_Mo_Smoke_white; @@ -20,7 +20,7 @@ class cfgMagazines { displayName = CSTRING(magazine_Smoke_displayName); descriptionShort = CSTRING(magazine_Smoke_descriptionShort); model = PATHTOF(data\l16_ammo_smk_white.p3d) - picture = PATHTOF(UI\w_l16_ammo_smk_white_ca.paa); + picture = PATHTOF(UI\w_l16_ammo_smk_white_ca.paa); mass = 10; }; class 8Rnd_82mm_Mo_Flare_white; @@ -32,7 +32,7 @@ class cfgMagazines { displayName = CSTRING(magazine_Illum_displayName); descriptionShort = CSTRING(magazine_Illum_descriptionShort); model = PATHTOF(data\l16_ammo_illum.p3d) - picture = PATHTOF(UI\w_l16_ammo_illum_ca.paa); + picture = PATHTOF(UI\w_l16_ammo_illum_ca.paa); mass = 10; }; class 8Rnd_82mm_Mo_guided; @@ -44,7 +44,7 @@ class cfgMagazines { displayName = CSTRING(magazine_HE_Guided_displayName); descriptionShort = CSTRING(magazine_HE_Guided_descriptionShort); model = PATHTOF(data\l16_ammo_he.p3d) - picture = PATHTOF(UI\w_l16_ammo_he_ca.paa); + picture = PATHTOF(UI\w_l16_ammo_he_ca.paa); mass = 10; }; class 8Rnd_82mm_Mo_LG; @@ -56,7 +56,7 @@ class cfgMagazines { displayName = CSTRING(magazine_HE_LaserGuided_displayName); descriptionShort = CSTRING(magazine_HE_LaserGuided_descriptionShort); model = PATHTOF(data\l16_ammo_he.p3d) - picture = PATHTOF(UI\w_l16_ammo_he_ca.paa); + picture = PATHTOF(UI\w_l16_ammo_he_ca.paa); mass = 10; }; }; diff --git a/addons/mk6mortar/config.cpp b/addons/mk6mortar/config.cpp index 52a9ac2347..3483229087 100644 --- a/addons/mk6mortar/config.cpp +++ b/addons/mk6mortar/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {"ACE_RangeTable_82mm","ace_mortar_82mm"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_interaction"}; - author[] = {"PabstMirror"}; + author[] = {"PabstMirror","Grey","VKing"}; authorUrl = "https://github.com/acemod"; VERSION_CONFIG; }; diff --git a/addons/mk6mortar/functions/fnc_canLoadMagazine.sqf b/addons/mk6mortar/functions/fnc_canLoadMagazine.sqf index 71671e9a61..4ba6db3720 100644 --- a/addons/mk6mortar/functions/fnc_canLoadMagazine.sqf +++ b/addons/mk6mortar/functions/fnc_canLoadMagazine.sqf @@ -19,7 +19,7 @@ #include "script_component.hpp" params ["_static","_unit",["_magazineClassOptional","",[""]]]; -private ["_canLoadMagazine","_currentMagazine","_weapon","_magazines","_listOfMagNames", +private ["_canLoadMagazine","_currentMagazine","_weapon","_listOfMagNames", "_hasCompatibleMagazine","_count"]; if !(alive _static) exitWith {false}; @@ -29,7 +29,6 @@ _canLoadMagazine = false; _currentMagazine = (magazinesAllTurrets _static) select 1; _weapon = (_static weaponsTurret [0]) select 0; -_magazines = magazines _unit; _listOfMagNames = getArray(configFile >> "cfgWeapons" >> _weapon >> "magazines"); _hasCompatibleMagazine = false; _count = 0; @@ -41,7 +40,7 @@ if (_magazineClassOptional != "") then { }; }else{ { - if ([_unit,_x] call EFUNC(common,hasMagazine)) exitWith {_hasCompatibleMagazine = true;}; + if ([_unit,_x] call EFUNC(common,hasMagazine)) exitWith {_hasCompatibleMagazine = true}; } forEach _listOfMagNames; }; //If static weapon has a magazine then find the ammo count diff --git a/addons/mk6mortar/functions/fnc_loadMagazine.sqf b/addons/mk6mortar/functions/fnc_loadMagazine.sqf index 48f78255d0..735244edc3 100644 --- a/addons/mk6mortar/functions/fnc_loadMagazine.sqf +++ b/addons/mk6mortar/functions/fnc_loadMagazine.sqf @@ -28,6 +28,7 @@ _currentMagazineClass = _currentMagazine select 0; _count = _currentMagazine select 2; //Check all of the players magazines to see if they are compatible with the static weapon. First magazine that is compatible is chosen +//VKing: This section ought to be double checked. _magazines = magazines _unit; _magazineDetails = magazinesDetail _unit; _listOfMagNames = getArray(configFile >> "cfgWeapons" >> _weapon >> "magazines"); @@ -50,7 +51,6 @@ if (_magazineClassDetails != "") then{ _parsed = _magazineClassDetails splitString "([]/: )"; _parsed params ["_type", "", "", "_roundsLeftText", "_maxRoundsText"]; _roundsLeft = parseNumber _roundsLeftText; - _roundsMax = parseNumber _maxRoundsText; _magType = _type; }; diff --git a/addons/mk6mortar/functions/fnc_loadMagazineTimer.sqf b/addons/mk6mortar/functions/fnc_loadMagazineTimer.sqf index 09348ee92c..16016f06e6 100644 --- a/addons/mk6mortar/functions/fnc_loadMagazineTimer.sqf +++ b/addons/mk6mortar/functions/fnc_loadMagazineTimer.sqf @@ -20,10 +20,9 @@ params ["_static","_unit","_timeToLoad",["_magazineClassOptional","",[""]]]; -private _progressText = localize LSTRING(loadingMortar); //Move player into animation if player is standing if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { [_unit, "AmovPercMstpSrasWrflDnon_diary", 1] call EFUNC(common,doAnimation); }; -[_timeToLoad, [_static,_unit,_magazineClassOptional], {(_this select 0) call FUNC(loadMagazine);}, {}, _progressText] call EFUNC(common,progressBar); +[_timeToLoad, [_static,_unit,_magazineClassOptional], {(_this select 0) call FUNC(loadMagazine)}, {}, localize LSTRING(loadingMortar)] call EFUNC(common,progressBar); diff --git a/addons/mk6mortar/functions/fnc_unloadMagazine.sqf b/addons/mk6mortar/functions/fnc_unloadMagazine.sqf index 3db8c058da..e81085d15f 100644 --- a/addons/mk6mortar/functions/fnc_unloadMagazine.sqf +++ b/addons/mk6mortar/functions/fnc_unloadMagazine.sqf @@ -18,10 +18,9 @@ #include "script_component.hpp" params ["_static","_unit"]; -private ["_weapon","_currentMagazine","_currentMagazineClass","_ammoCount"]; +private ["_currentMagazine","_currentMagazineClass","_ammoCount"]; //Get weapon & magazine information about static weapon -_weapon = (_static weaponsTurret [0]) select 0; _currentMagazine = (magazinesAllTurrets _static) select 1; _currentMagazineClass = _currentMagazine select 0; _ammoCount = _currentMagazine select 2; @@ -31,6 +30,8 @@ if (_ammoCount == 0) then { [QGVAR(removeMagazine), [_static, _currentMagazineClass]] call EFUNC(common,globalEvent); }else { _pos = _unit modelToWorldVisual [0,1,0]; + // TODO: Check unit inventory space and add to inventory first, then drop + _unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"]; _unit addMagazineAmmoCargo [_currentMagazineClass, 1, _ammoCount]; _unit setPosATL _pos; diff --git a/addons/mk6mortar/functions/fnc_unloadMagazineTimer.sqf b/addons/mk6mortar/functions/fnc_unloadMagazineTimer.sqf index ad2cac8c2a..151f35492a 100644 --- a/addons/mk6mortar/functions/fnc_unloadMagazineTimer.sqf +++ b/addons/mk6mortar/functions/fnc_unloadMagazineTimer.sqf @@ -20,11 +20,9 @@ params ["_static","_unit","_timeToUnload"]; -private _progressText = localize LSTRING(unloadingMortar); - //Move player into animation if player is standing if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { [_unit, "AmovPercMstpSrasWrflDnon_diary", 1] call EFUNC(common,doAnimation); }; -[_timeToUnload, [_static,_unit], {(_this select 0) call FUNC(unloadMagazine);}, {}, _progressText] call EFUNC(common,progressBar); +[_timeToUnload, [_static,_unit], {(_this select 0) call FUNC(unloadMagazine)}, {}, localize LSTRING(unloadingMortar)] call EFUNC(common,progressBar);