diff --git a/addons/csw/functions/fnc_proxyWeapon.sqf b/addons/csw/functions/fnc_proxyWeapon.sqf index edd3084238..8771dc8b39 100644 --- a/addons/csw/functions/fnc_proxyWeapon.sqf +++ b/addons/csw/functions/fnc_proxyWeapon.sqf @@ -26,19 +26,20 @@ if (_vehicle getVariable [format [QGVAR(proxyHandled_%1), _turret], false]) exit private _proxyWeapon = getText (configOf _vehicle >> "ace_csw" >> "proxyWeapon"); TRACE_2("",typeOf _vehicle,_proxyWeapon); -if (_proxyWeapon == "") exitWith {}; +if (_proxyWeapon isEqualTo "") exitWith {}; private _currentWeapon = (_vehicle weaponsTurret [0]) param [0, "#none"]; if ((missionNamespace getVariable [_proxyWeapon, objNull]) isEqualType {}) then { // check if string is a function TRACE_1("Calling proxyWeapon function",_proxyWeapon); // This function may replace magazines or do other things to the static weapon _proxyWeapon = [_vehicle, _turret, _currentWeapon, _needed, _emptyWeapon] call (missionNamespace getVariable _proxyWeapon); - _needed = _proxyWeapon != ""; + _needed = _proxyWeapon isNotEqualTo "" && {_proxyWeapon isNotEqualTo _currentWeapon}; }; if (!_needed) exitWith { TRACE_2("not needed",_needed,_proxyWeapon); }; // Config case for hashmap key _proxyWeapon = configName (configFile >> "CfgWeapons" >> _proxyWeapon); +if (_proxyWeapon isEqualTo "") exitWith {ERROR_1("proxy weapon non-existent for [%1]", _currentWeapon)} // Cache compatible magazines if !(_proxyWeapon in GVAR(compatibleMagsCache)) then {