I managed to build my first debug dll and tried to fix an error that has been occuring in my mod. It crashed always when loading xml. Then i tried running the mod with debug dll and got a strange error message.
I haven't seen this kind of message before so if anyone could tell me what exactly it tells? I took closer look on that CvXMLLoadUtilitySet.cpp line 1337. Here's the whole function
The red line is the line 1337. I have actually no idea how to fix this. Could this be because of the new promotion tags I have added to DLL and xml?
I haven't seen this kind of message before so if anyone could tell me what exactly it tells? I took closer look on that CvXMLLoadUtilitySet.cpp line 1337. Here's the whole function
Spoiler :
Code:
//------------------------------------------------------------------------------------------------------
//
// FUNCTION: SetGlobalClassInfo - This is a template function that is USED FOR ALMOST ALL INFO CLASSES.
// Each info class should have a read(CvXMLLoadUtility*) function that is responsible for initializing
// the class from xml data.
//
// PURPOSE : takes the szTagName parameter and loads the ppszString with the text values
// under the tags. This will be the hints displayed during game initialization and load
//
//------------------------------------------------------------------------------------------------------
template <class T>
void CvXMLLoadUtility::SetGlobalClassInfo(std::vector<T*>& aInfos, const char* szTagName, bool bTwoPass)
{
char szLog[256];
sprintf(szLog, "SetGlobalClassInfo (%s)", szTagName);
PROFILE(szLog);
logMsg(szLog);
// if we successfully locate the tag name in the xml file
if (gDLL->getXMLIFace()->LocateNode(m_pFXml, szTagName))
{
// loop through each tag
do
{
SkipToNextVal(); // skip to the next non-comment node
T* pClassInfo = new T;
FAssert(NULL != pClassInfo);
if (NULL == pClassInfo)
{
break;
}
bool bSuccess = pClassInfo->read(this);
[COLOR="Red"]FAssert(bSuccess);[/COLOR]
if (!bSuccess)
{
delete pClassInfo;
break;
}
int iIndex = -1;
if (NULL != pClassInfo->getType())
{
iIndex = GC.getInfoTypeForString(pClassInfo->getType(), true);
}
if (-1 == iIndex)
{
aInfos.push_back(pClassInfo);
if (NULL != pClassInfo->getType())
{
GC.setInfoTypeFromString(pClassInfo->getType(), (int)aInfos.size() - 1); // add type to global info type hash map
}
}
else
{
SAFE_DELETE(aInfos[iIndex]);
aInfos[iIndex] = pClassInfo;
}
} while (gDLL->getXMLIFace()->NextSibling(m_pFXml));
if (bTwoPass)
{
// if we successfully locate the szTagName node
if (gDLL->getXMLIFace()->LocateNode(m_pFXml, szTagName))
{
gDLL->getXMLIFace()->SetToParent(m_pFXml);
gDLL->getXMLIFace()->SetToChild(m_pFXml);
// loop through each tag
for (std::vector<T*>::iterator it = aInfos.begin(); it != aInfos.end(); ++it)
{
SkipToNextVal(); // skip to the next non-comment node
(*it)->readPass2(this);
if (!gDLL->getXMLIFace()->NextSibling(m_pFXml))
{
break;
}
}
}
}
}
}