UIS Loadout issue on respawn

Shanmukh

Member
On every time respawn, adding new loadout to Existing loadout. it continuously increasing inventory, every time respawn.
I want to set up, reset the loadout on Respawn.
 

Sangemdoko

Moderator
Staff member
You are correct, there was a bug. The items were not all being removed.

Make the RemoveAllItems function virtual in the Inventory script of the Character Controller
Code:
public virtual void RemoveAllItems(bool drop)


And add this to the Character Inventory Bridge script.
Code:
 /// <summary>
 /// Remove all the items.
 /// </summary>
 /// <param name="drop">Drop the removed Items.</param>
 public override void RemoveAllItems(bool drop)
 {
     var allItemInfos = m_Inventory.AllItemInfos;
     for (int i = allItemInfos.Count - 1; i >= 0; i--) {
         // Multiple items may be dropped at the same time.
         if (allItemInfos.Count <= i) {
             continue;
         }
         if (drop) {
             DropItem(allItemInfos[i], true, true);
         } else {
             m_Inventory.RemoveItem(allItemInfos[i]);
         }
     }
 }

Now all the items will be removed before the loadout is loaded again.

This change will be part of the next update
 
Top