Facepunch / sbox-issues

177 stars 12 forks source link

FileSystem JSON doesn't load ILists #1697

Open ItsRifter opened 2 years ago

ItsRifter commented 2 years ago

Describe the bug Filesystem doesn't load the file fully with the ILists despite successfully being saved

To Reproduce

  1. Download the Git: https://github.com/ItsRifter/Project-Darkness
  2. Spawn an item using ent_create crowbar and obtain it
  3. Use command pd_save then restart
  4. Attempt to assign ActiveChild with pd_setweapon crowbar command
  5. No errors displayed but the playerdata InventoryItems appears empty or null when using Log.Info after load

Expected behavior The IList should be loaded from the json file and not appear null In this case using the steps, the crowbar should be the active child / weapon

Additional context Adding a setter to the inventoryitems then loading causes crashes

handsomematt commented 2 years ago
public IList<PlayerItem> InventoryItems { get; }

Have you tried with it having a setter.

ItsRifter commented 2 years ago

As stated in additional context, I have but resulted in crashes on my end