forums | blogs | polls | tutorials | downloads | rules | help

Add new comment

The party members item count isn't accounting for equipped items. I suggest an accuracy code fix below.
For ListItem call we need to tag the search to include EQUIPPED item via the true switch.
hand_1 and hand_2 are not passed to the list probably because of the unique handling for dual wield and shield. The end code change handles their enumeration.
(Note: ListItem (IL_ALL) - will list the spells within an equipped spellbook but not the equipped spellbook. This behavior would be undesired since we are enumerating the spellbook from the EQUIPED switch(true). )

cut and paste over(replace) into the section added by CSDDAb not the similar instance of Killergremals original code. use 'find' > "CSDDAb".

member$.Inventory.ListItems(IL_MAIN, AIQuery.TempGopColl1, true);
numItems$ = AIQuery.TempGopColl1.Size();
numSubItems$ = 0;
i$ = 0;
report$ = "";
temp$ = "";
while(i$ < numItems$)
{
Go item$ = AIQuery.TempGopColl1.Get(i$) ;
if (item$ != NULL)
{
if (numItems$ == 1 && item$.HasCommon)
{
item$.Common.GetScreenName(temp$);
}
if (item$.HasInventory()) // FOR SPELL BOOKS OR MAYBE BACK-PACKS ONCE:
{
eInventoryLocation inv_loc$ = (item$.HasGui && item$.Gui.IsSpellBook) ? IL_ALL_SPELLS : IL_MAIN ;
AIQuery.TempGopColl2.Clear();
item$.Inventory.ListItems(inv_loc$, AIQuery.TempGopColl2, false);
numSubItems$ += AIQuery.TempGopColl2.size();
}
}
i$ += 1;
}
if (member$.Inventory.GetItem( il_hand_1 ) != NULL)
{
numSubItems$ += 1;
}
if (member$.Inventory.GetItem( il_hand_2 ) != NULL)
{
numSubItems$ += 1;
}
numItems$ += numSubItems$;