Hrm... with the initlist properly placed those asserts shouldn't fire off. So something is going wrong at that point.
What you posted here for your CopyNonDefaults was just the initializing of the lists, not also the carrying data from pClassInfo. Without that you should wind up with 0 values where you don't want them. Not the error we have at present, so just keep that in mind in case you do run into that error in the future.
-------------------------------
Ok, so breaking out the CvXMLLoadUtility and looking at precisely what is happening with WoC:
After ReadPass1 has executed and done their CND and everything else, we run to CNDr2 if we are pass 2:
First, we create a blank pClassInfo. Absolutely no data is in this thing.
Now we have this blank thing run readPass2. NOTE: We have NEVER run ::read(pXML) on this thing, so all arrays need to be initialized during pass 2 if they are to be utilized in CNDr2 later.
Now we check dependency junk, ignoring that.
Odd, now if we clear out dependencies, we run read(pXML)... AFTER having done pass2. I am lost on that one. Shouldn't matter in the end though since we trash this data.
Now we use the Type to look up what the enum for this item is. At this point it absolutely DOES exist, since we have already run read(pXML) on this earlier, when we didn't know yet if it was going to do a pass2 at all.
Now we use the enum to look up the stored data for this object, and we pass our pClassInfo to the pre-existing data so that it can copy out whatever it requires.
Now we delete our strange backward read data for good.
-----------------------------
Ok, so there is pass2 of WoC. I guess if you want pass1 as well sometime I can do that for you as well, don't much feel like it at the moment. Basically the same thing, but at the end it works the other way around (you copy the preexisting data into the stuff you just loaded, then overwrite what had already existed before)
So that is why the init in pass1 works fine, because it is executed after pass2 is in the modules.
In CvXMLLoadUtilitySet.cpp, place a breakpoint on the last of these lines:
Code:
T* pClassInfo = new T;
FAssert(NULL != pClassInfo);
//Second readpass information is loaded into a completely new set of data
bool bSuccess = pClassInfo->readPass2(this);
It'll fire off quite a bit (every XML object you have in every module), so leave it disabled initially, and have one enabled at the start of CvCivicInfo::read(pXML). When that one fires, you are now loading civics, so go turn on the one in CvXMLLoadUtilitySet so you can see the pass2 stuff coming up. When this breakpoint fires, you haven't run pass2 for the module yet, so step forward one line (step over, not step into) and then do a mouseover on pClassInfo and check the TYPE so you know which item you are loading. Once you have noted what is loading, let the code resume. This way you can figure out which XML item is actually loading when you get your crash. Might help to narrow down the actual issue, at the least it allows you to walk through step by step with the guilty party and see precisely what happens before the crash, might help as well.
Oh, when placing the breakpoint in CvXML, don't use the comment to find the code area, that is probably my comment, so won't be in your code.