Solved Removing items from container?

Discussion in 'Rust Development' started by 4lex, Dec 5, 2016.

  1. What is the best method in removing items from a container
    I am currently using container.itemList.Clear(); where container comes from (ItemContainer container).
    Is there any better way of doing this?
     
  2. Code:
    Item.Remove(float)
    ....
    myItem.Remove(0f);
     
  3. Code:
            void ClearContainer(ItemContainer container)
            {
                while (container.itemList.Count > 0)
                {
                    var item = container.itemList[0];
                    item.RemoveFromContainer();
                    item.Remove(0f);
                }
            }
     
  4. Thanks worked perfectly a lot cleaner and I am no longer getting spam in console for ParentBecoming Missing
     
  5. Sounds very good...happy coding :p