rheirman / GiddyUpCore

20 stars 22 forks source link

Fixes an error you get with some unknown mods #23

Closed Ashnal closed 4 years ago

Ashnal commented 4 years ago

By adding an extra check to see if the item already exists in the collection.

This error comes up occasionally for some people and seems to be harmless, so to get this out of the hair of mod load order troubleshooters everywhere here's a small fix.

Error for reference: [HugsLib][ERR] GiddyUpCore caused an exception during OnDefsLoaded: System.ArgumentException: An element with the same key already exists in the dictionary. at System.Collections.Generic.Dictionary`2[Verse.PawnKindDef,System.Single].Add

Ashnal commented 4 years ago

Pulled trigger a little too early ... didn't fix as I expected.

Ashnal commented 4 years ago

Check, does actually work. Please add.

rheirman commented 4 years ago

Thanks for the fix!