ToggleEquip allows switching to item not present in inventory

CitrioN

New member
I'm using runtime pickups and experienced that it is possible to use the ToggleEquip ability to switch to the ItemSet for which the item is no longer in the inventory.
I've dropped the inventory using the provided Drop ability.
I checked the code a bit and found this bit of code in ToggleEquip which does not have a value of -1 even though the only item in my inventory is the body type which is also the default ItemSet and marked to not be dropped ever:
C#:
// PrevItemSetIndex will equal -1 if no non-default items have been equipped.
if (m_PrevItemSetIndex == -1) {
    return false;
}
It looks to me that dropping the runtime weapons/pickups do not reset this variable to -1 hence CanStartAbility returns true and switches to the ItemSet without the item.
Could this be some unintended behavior related to the fixes for Runtime Item Pickups & Drop Item Ability?
 
What are the steps to reproduce this? I tried in the demo scene starting with just the default Body in the inventory, then picking up a runtime item (the Bow), then dropping it and using the toggle equip ability, but nothing unexpected happened.
 
It was probably caused by some interference with my own code integration.
I can no longer reproduce this so I'll mark it as solved.
Sorry for the inconvenience.
 
Top