public virtual void GenerateContent() { if (m_Content == null || Deleted) { return; } int toSpawn = GetSpawnCount(); for (int i = 0; i < toSpawn; ++i) { Item item = m_Content.Construct(); if (item == null) { continue; } if (!Items.Not(subItem => subItem is Container).Any(subItem => subItem.StackWith(null, item, false)) || !item.Deleted) { DropItem(item); } } }
public virtual void GenerateContent() { if (m_Content == null || Deleted) { return; } int toSpawn = GetSpawnCount(); for (int i = 0; i < toSpawn; ++i) { Item item = m_Content.Construct(); if (item != null) { List <Item> list = this.Items; for (int j = 0; j < list.Count; ++j) { Item subItem = list[j]; if (!(subItem is Container) && subItem.StackWith(null, item, false)) { break; } } if (item != null && !item.Deleted) { DropItem(item); } } } }