mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Merge pull request #295 from andrzejfalkowski/xml-backgrounds-parse-fix
Fixed drugtypes and drugitems background tags causing subsequent tags in the same background to be skipped
This commit is contained in:
@@ -168,7 +168,7 @@ backgroundStartElementHandle(void *userData, const XML_Char *name, const XML_Cha
|
||||
else if (strcmp(name, "drugitems") == 0 && pData->curElement == ELEMENT)
|
||||
{
|
||||
pData->curElement = ELEMENT_VECTOR_OF_NUMBERS;
|
||||
pData->curBackground.valueVectors[BackgroundVectorTypes::BG_DRUGUSE_TYPES].clear();
|
||||
pData->curBackground.valueVectors[BackgroundVectorTypes::BG_DRUGUSE_ITEMS].clear();
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
@@ -693,6 +693,14 @@ backgroundEndElementHandle(void *userData, const XML_Char *name)
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curBackground.uiFlags |= (UINT16)atol(pData->szCharData) ? BACKGROUND_CIVGROUPLOYAL : 0;
|
||||
}
|
||||
else if (strcmp(name, "drugtypes") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
}
|
||||
else if (strcmp(name, "drugitems") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
}
|
||||
else if (strcmp(name, "drugtype") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT_VECTOR_OF_NUMBERS;
|
||||
|
||||
Reference in New Issue
Block a user