Valkrionn
The Hamster King
Alright, we've had issues for a while in RifE (and FF, and WM afaik) with modular events. I've dug into it finally and found the cause.... But have no idea how to fix it.
The issue is with a ReadPass2 function. I've tried to find other examples of this method in the code... But it only appears with Events, Techs, and Projects, and in each case involves the exact tags that screw up modular loading for those files.
So, I really don't know what's wrong with it.
As an idea of what it causes... It looks like it's loading maxints into the list. It does this even for completely unmodified events.
The issue is with a ReadPass2 function. I've tried to find other examples of this method in the code... But it only appears with Events, Techs, and Projects, and in each case involves the exact tags that screw up modular loading for those files.

Code:
void CvEventInfo::copyNonDefaultsReadPass2(CvEventInfo* pClassInfo, CvXMLLoadUtility* pXML)
{
bool bOver = pClassInfo->isForceOverwrite();
CvString cDefault = CvString::format("").GetCString();
CvWString wDefault = CvWString::format(L"").GetCString();
if(!m_piAdditionalEventChance) pXML->InitList(&m_piAdditionalEventChance, GC.getNumEventInfos(), 0);
if(!m_piAdditionalEventTime) pXML->InitList(&m_piAdditionalEventTime, GC.getNumEventInfos(), 0);
if(!m_piClearEventChance) pXML->InitList(&m_piClearEventChance, GC.getNumEventInfos(), 0);
for (int i = 0; i < GC.getNumEventInfos(); ++i)
{
if(bOver || pClassInfo->getAdditionalEventChance(i) != 0) m_piAdditionalEventChance[i] = pClassInfo->getAdditionalEventChance(i);
if(bOver || pClassInfo->getAdditionalEventTime(i) != 0) m_piAdditionalEventTime[i] = pClassInfo->getAdditionalEventTime(i);
if(bOver || pClassInfo->getClearEventChance(i) != 0) m_piClearEventChance[i] = pClassInfo->getClearEventChance(i);
}
}
As an idea of what it causes... It looks like it's loading maxints into the list. It does this even for completely unmodified events.
