GetEquipmentInventoryIndexOfEquipmentTypeBJ
- Parameters
whichUnit unitwhichEquipmentType equipmentType- comment
- bug
Leaks handle
indexItem: In Jass you must set local variables that hold agents (or any child type) tonullat the end of functions to avoid reference counter leaks.- patch
3.0.0.24268
- Source
- Blizzard.j (raise an issue to discuss on Github or submit a PR)
- return type
integer- Source code
function GetEquipmentInventoryIndexOfEquipmentTypeBJ takes unit whichUnit, equipmentType whichEquipmentType returns integer local integer index local item indexItem set index = 0 loop set indexItem = UnitItemInEquipmentSlot(whichUnit, ConvertLoadoutSlot(index)) if (indexItem != null) and (GetItemEquipmentType(indexItem) == whichEquipmentType) then return index + 1 endif set index = index + 1 exitwhen index >= bj_MAX_EQUIPMENT_INVENTORY endloop return 0 endfunction