Originally Posted by Baertram
GetItemlinkActorCategory returns category type for companions
|
Once again, Baer to the rescue
I also was using the text search approach, didn't know about this but the following code seems to work and is much nicer than what I had:
Code:
local numSlots = GetBagSize(BAG_BACKPACK)
for bSlot = 1, numSlots do
-- Look up item info
local link = GetItemLink(BAG_BACKPACK, bSlot)
if link then -- (Hi siri...)
if GetItemLinkActorCategory(link) == GAMEPLAY_ACTOR_CATEGORY_COMPANION then
d("Found a companion item: " .. link);
end -- if GILAC == 1
end -- if link ! nil
end -- bSlot loop