javisar / ONI-Modloader

A modloader for Oxygen Not Included
MIT License
72 stars 25 forks source link

Modloader gives error when loading the same mod twice. #17

Closed rainbowdesign closed 6 years ago

rainbowdesign commented 6 years ago

I get an error with the modloader, i try to load the same mod in different files. i am not so sure how good the idea is in general but it seems the modloader does not play well with it: i thing you should check if loadableMods.Add(vertex.name, vertex); contains the mod already or dont do it with .Add the output is:

[= INFO =] Loading RadioActiveMod, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [= INFO =] Loading RadioActiveMod, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [= INFO =] Loading RadioActiveMod, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [= INFO =] Loading ModHelper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null ArgumentException: element already exists at System.Collections.Generic.SortedList2[System.String,ModLoader.DependencyGraph+Vertex].PutImpl (System.String key, ModLoader.Vertex value, Boolean overwrite) [0x00000] in :0 at System.Collections.Generic.SortedList2[System.String,ModLoader.DependencyGraph+Vertex].Add (System.String key, ModLoader.Vertex value) [0x00000] in :0 at ModLoader.DependencyGraph.TopologicalSort () [0x00000] in :0 at ModLoader.ModLoader.Start () [0x00000] in :0 at ModLoader.Activator.Activate () [0x00000] in :0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in :0 at LaunchInitializer.Update () [0x00000] in :0

rainbowdesign commented 6 years ago

Nevermind, i made up my mind i will now do it with only one modfile.

javisar commented 6 years ago

Ok