Plugin won't load

Error while compiling Loadoutless: '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?) | Line: 944, Pos: 56

The best I've found is this:

Developer FYI - PlayerInventory.AllItems() is going away with October force wipe, and in its place is PlayerInventory.AllItems(List<Item> items). If you have code like this:

 
foreach (var item in player.inventory.AllItems()){ // blah blah blah}

...you can fix it like this:

var itemList = Pool.Get<List<Item>>();player.inventory.GetAllItems(itemList);foreach (var item in itemList){ // blah blah blah}Pool.Free(ref itemList);

I see AllItems() so it's the same thing
need to create a list, pass it into GetAllItems(), then pass the list to AddInvBan() - then free the list if you got it from a pool
or, run AddInvBan over each of the 3 individual item lists

Excuse my ignorance, but could you explain in more detail?

barerust

The best I've found is this:

Developer FYI - PlayerInventory.AllItems() is going away with October force wipe, and in its place is PlayerInventory.AllItems(List<Item> items). If you have code like this:

 
foreach (var item in player.inventory.AllItems()){ // blah blah blah}

...you can fix it like this:

var itemList = Pool.Get<List<Item>>();player.inventory.GetAllItems(itemList);foreach (var item in itemList){ // blah blah blah}Pool.Free(ref itemList);

I see AllItems() so it's the same thing
need to create a list, pass it into GetAllItems(), then pass the list to AddInvBan() - then free the list if you got it from a pool
or, run AddInvBan over each of the 3 individual item lists

This is not a correct fix. "Pool.Get<List<Item>>()" does not exist in this context and will do nothing but give you more errors. We need to be able to get the current player's inventory and add them to the Ban function.

A quick solution to this is to just comment the line "AddInvBan(player.inventory.AllItems());" with "//"
example: "//AddInvBan(player.inventory.AllItems());"
This will basically disable this function call. The trade-off is you can't use the function for banning items in your inventory which is fine if you've done that already previously, this is just a quick fix until the actual developer fixes this code.

"



Merged post

I've fixed the plugin but, I don't know how to upload it to umod. Here it is: 
Loadoutless Working Plugin for October 2024 Update