Closed Pychnight closed 2 years ago
This is annoying bug that occasionally prevents Custom Npcs 2 from reloading files properly using the /reload command.
This should be fixed after #65 is completed.
TDefinition contains "Name" field. Npcs contain "CustomID" field.
TDefinition .Name = Npc["CustomID"].ToString();
The plugin will occasionally try during reload to load the same items, that have already exist within the directory.
Improve loading logic for all plugins Ensure that code for loading files is clean and can be reloaded during server run Ensure that items are cleaned up.
IF possible standardize the loading logic... it seems all plugins do this in there own way but the data is pretty alike, so it might be possible to just create a single core controller..
Error log
[05/26/19 02:33:16] [Server API] Warning: Plugin "CustomNpcs" has had an unhandled exception thrown by one of its GamePostInitialize handlers: System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException (System.ExceptionResource resource) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0 at System.Collections.Generic.Dictionary
2[TKey,TValue].Insert (TKey key, TValue value, System.Boolean add) [0x0008e] in <8f2c484307284b51944a1a13a14c0266>:0 at System.Collections.Generic.Dictionary2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0 at CustomNpcs.CustomTypeManager
1[TCustomType].LoadDefinitions () [0x002c0] in1[ArgsType].Invoke (ArgsType args) [0x0004d] in <dbe9cd2e9eff467eb81ce247e7a9b53d>:0