Failed compiling 'FancyGrenades.cs': 1. 'PlayerInventory' does not contain a definition for 'AllItems' and no accessible extension method 'AllItems' accepting a first argument of type 'PlayerInventory' could be found (are you missing a using directive or an assembly reference?) [CS1061] (FancyGrenades 51 line 383)
Lines 381 to 386 old code
{
ItemDefinition item = ItemManager.FindItemDefinition(shortname);
Item[] playerItems = player.inventory.AllItems();
return playerItems.FirstOrDefault(x => x.info == item) == null ? 0 : playerItems.FirstOrDefault(x => x.info == item).amount;
}
Lines 381 to 387 new code change to this.
{
ItemDefinition item = ItemManager.FindItemDefinition(shortname);
List<Item> playerItems = new List<Item>();
player.inventory.GetAllItems(playerItems);
return playerItems.FirstOrDefault(x => x.info == item) == null ? 0 : playerItems.FirstOrDefault(x => x.info == item).amount;
}