A13 - Custom defs with duplicate class names crash mod loading

Started by Fluffy (l2032), May 19, 2016, 03:17:48 PM

Previous topic - Next topic

Fluffy (l2032)

Problem:
Two different mods create custom Def class (that is class in the C# sense), with the same name, but in different namespaces.
The game errors during mod load, mod config is reset.

Expectation:
Since the classes are namespaced, there should be no conflict an the game should run fine.

Replication:
Load the attached mod. It does absolutely nothing, but highlights the problem.

Solution:
In Verse.XmlLoader.AllDefsFromAsset, change
typeof(Def).AllSubclasses().ToDictionary((Type x) => x.Name);
to
typeof(Def).AllSubclasses().ToDictionary((Type x) => x.FullName);

( there may be more changes to be made, but this is the source of the issue ).



[attachment deleted by admin - too old]

ison