Fixes an issue where manually loaded PoTItems, namely InstancedVanillaClones, would throw an error upon using /spawnitem in-game due to Activator.CreateInstance expecting a parameterless ctor.
Reworked PoTItem.AllItems and all peripheral code to store item by ID instead of by Type, so a single Type can have more than one item.
Fixed all item spawning code to take an ID instead of a Type, and properly cloned the item instead of using Activator.CreateInstance with manually loaded items.
Comments
I did rewrite a good portion of PoTItem's autoloading. This should not change anything as the IoC will do it all automatically, and using ItemSpawner.GetTypeFromId(int) will get you the Type from an item ID automatically if needed.
### Link Issues Resolves: #265
Description of Work
Fixes an issue where manually loaded PoTItems, namely InstancedVanillaClones, would throw an error upon using
/spawnitem
in-game due toActivator.CreateInstance
expecting a parameterless ctor. Reworked PoTItem.AllItems and all peripheral code to store item by ID instead of byType
, so a singleType
can have more than one item. Fixed all item spawning code to take an ID instead of aType
, and properly cloned the item instead of usingActivator.CreateInstance
with manually loaded items.Comments
I did rewrite a good portion of PoTItem's autoloading. This should not change anything as the IoC will do it all automatically, and using
ItemSpawner.GetTypeFromId(int)
will get you the Type from an item ID automatically if needed.