From 5b3f77d756072edcb0586034c372a45d4b59a650 Mon Sep 17 00:00:00 2001 From: Salluci Date: Thu, 13 Jul 2023 21:01:02 +0300 Subject: [PATCH] remove proxy weapon function --- addons/mk6mortar/CfgVehicles.hpp | 2 +- addons/mk6mortar/XEH_PREP.hpp | 1 - .../functions/fnc_csw_getProxyWeapon.sqf | 58 ------------------- 3 files changed, 1 insertion(+), 60 deletions(-) delete mode 100644 addons/mk6mortar/functions/fnc_csw_getProxyWeapon.sqf diff --git a/addons/mk6mortar/CfgVehicles.hpp b/addons/mk6mortar/CfgVehicles.hpp index 41e45abf35..299b91192a 100644 --- a/addons/mk6mortar/CfgVehicles.hpp +++ b/addons/mk6mortar/CfgVehicles.hpp @@ -27,7 +27,7 @@ class CfgVehicles { }; class Mortar_01_base_F: StaticMortar { class ace_csw { - proxyWeapon = QFUNC(csw_getProxyWeapon); + proxyWeapon = "ACE_mortar_82mm"; magazineLocation = "_target selectionPosition 'usti hlavne'"; }; class Turrets: Turrets { diff --git a/addons/mk6mortar/XEH_PREP.hpp b/addons/mk6mortar/XEH_PREP.hpp index dd052a993e..efc6ce4219 100644 --- a/addons/mk6mortar/XEH_PREP.hpp +++ b/addons/mk6mortar/XEH_PREP.hpp @@ -1,5 +1,4 @@ -PREP(csw_getProxyWeapon); PREP(handleFired); PREP(handlePlayerVehicleChanged); PREP(moduleInit); diff --git a/addons/mk6mortar/functions/fnc_csw_getProxyWeapon.sqf b/addons/mk6mortar/functions/fnc_csw_getProxyWeapon.sqf deleted file mode 100644 index 6b19dcf996..0000000000 --- a/addons/mk6mortar/functions/fnc_csw_getProxyWeapon.sqf +++ /dev/null @@ -1,58 +0,0 @@ -#include "script_component.hpp" -/* - * Author: PabstMirror - * Compatibility With ACE_CSW (will be called by ace_csw, no dependency) - * Setting Init has finished, and this runs before csw attempts to unload weapon, should replicate functionality of mk6_fnc_mortarInit - * - * Arguments: - * 0: static - * 1: Turret - * 2: current weapon - * 3: need proxy weapon (either assembly mode is true, or weapon has been emptied and is being reloaded) - * - * Return Value: - * Proxy Weapon - * - * Example: - * [mortar, "mortar_82mm", true] call ace_mk6mortar_fnc_csw_getProxyWeapon - * - * Public: No - */ - -params ["_mortar", "_turret", "_currentWeapon", "_proxyWeaponNeeded"]; -TRACE_4("csw_getProxyWeapon",_mortar,_turret,_currentWeapon,_proxyWeaponNeeded); - -private _newWeapon = ""; - -if (GVAR(useAmmoHandling)) then { - if (_currentWeapon != "mortar_82mm") exitWith { ERROR_2("unknown weapon [%1 - %2]",typeOf _mortar,_currentWeapon); }; - - // Replace weapon with fast reloading version - _newWeapon = "ace_mortar_82mm"; - TRACE_1("replacing weapon",_newWeapon); - - // need to convert 8rnd mags to 1rnd mags for new weapon (we need to do this so the weapon is loaded with a compatible mag) - private _magsToRemove = []; - private _convertedMags = []; - { - _x params ["_xMag", "_xTurret", "_xAmmo"]; - if (_xTurret isEqualTo _turret) then { - private _replaceMag = GVAR(ammoHandlingMagazineReplacement) getOrDefault [_xMag, ""]; - if (_replaceMag != "") then { - _magsToRemove pushBackUnique [_xMag, _xTurret]; - TRACE_3("replacing",_xMag,_replaceMag,_xAmmo); - for "_i" from 1 to _xAmmo do { - _convertedMags pushBack [_replaceMag, _xTurret, 1]; - }; - } else { - WARNING_1("unknown mag %1", _xMag); - }; - }; - } forEach (magazinesAllTurrets _mortar); - - // remove orignal mags and add 1rnd versions: - { _mortar removeMagazinesTurret _x; } forEach _magsToRemove; - { _mortar addMagazineTurret _x; } forEach _convertedMags; -}; - -_newWeapon