Use the correct CBA function name, defining it in ACE as long as it doesn't exist already.

This commit is contained in:
esteldunedain 2016-03-05 13:11:20 -03:00
parent d886289716
commit 62f598b2a6
3 changed files with 9 additions and 7 deletions

View File

@ -4,14 +4,16 @@ ADDON = false;
#include "XEH_PREP.hpp"
FakeCBA_fnc_getMagazineIds = {
params [["_unit", objNull, [objNull]], ["_magazine", "", [""]]];
if (isNil "CBA_fnc_getMagazineIds") then {
CBA_fnc_getMagazineIds = {
params [["_unit", objNull, [objNull]], ["_magazine", "", [""]]];
private _displayName = getText (configFile >> "CfgMagazines" >> _magazine >> "displayName");
private _displayName = getText (configFile >> "CfgMagazines" >> _magazine >> "displayName");
if (_displayName isEqualTo "") exitWith {[]};
if (_displayName isEqualTo "") exitWith {[]};
magazinesDetail _unit select {_x find _displayName == 0} apply {_x = _x splitString "[:]"; _x select (count _x - 1)};
magazinesDetail _unit select {_x find _displayName == 0} apply {_x = _x splitString "[:]"; _x select (count _x - 1)};
};
};
ADDON = true;

View File

@ -21,7 +21,7 @@ params ["_unit", "_weapon", "_weaponTemp", "_barrelMass"];
TRACE_4("loadCoolestSpareBarrel1",_unit,_weapon,_weaponTemp,_barrelMass);
// Find all spare barrel the player has
private _allBarrels = [_unit, "ACE_SpareBarrel"] call FakeCBA_fnc_getMagazineIds;
private _allBarrels = [_unit, "ACE_SpareBarrel"] call CBA_fnc_getMagazineIds;
TRACE_1("_allBarrels",_allBarrels);
if ((count _allBarrels) < 1) exitWith {};

View File

@ -19,7 +19,7 @@ params ["_player","_unit"];
// Find all spare barrel the player has
TRACE_2("sendSpareBarrelsTemperatureHunt",_player,_unit);
private _allBarrels = [_unit, "ACE_SpareBarrel"] call FakeCBA_fnc_getMagazineIds;
private _allBarrels = [_unit, "ACE_SpareBarrel"] call CBA_fnc_getMagazineIds;
TRACE_1("_allBarrels",_allBarrels);
if ((count _allBarrels) < 1) exitWith {};