mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
- enabled town names in cities.xml
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@597 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -358,6 +358,7 @@ typedef enum
|
||||
CITYTABLE_ELEMENT_CITYLIST,
|
||||
CITYTABLE_ELEMENT_CITY,
|
||||
CITYTABLE_ELEMENT_INDEX,
|
||||
CITYTABLE_ELEMENT_NAME,
|
||||
CITYTABLE_ELEMENT_BASESECTOR,
|
||||
CITYTABLE_ELEMENT_BASESECTOR_X,
|
||||
CITYTABLE_ELEMENT_BASESECTOR_Y,
|
||||
@@ -372,6 +373,7 @@ typedef struct
|
||||
UINT8 ubBaseX;
|
||||
UINT8 ubBaseY;
|
||||
POINT townPoint;
|
||||
CHAR8 cityName[MAX_TOWN_NAME_LENGHT];
|
||||
} cityInfo;
|
||||
|
||||
typedef struct
|
||||
@@ -436,6 +438,11 @@ citytableStartElementHandle(void *userData, const char *name, const char **atts)
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
else if(strcmp(name, "cityName") == 0 && pData->curElement == CITYTABLE_ELEMENT_CITY)
|
||||
{
|
||||
pData->curElement = CITYTABLE_ELEMENT_NAME;
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
else if(strcmp(name, "uiIndex") == 0 && pData->curElement == CITYTABLE_ELEMENT_CITY)
|
||||
{
|
||||
pData->curElement = CITYTABLE_ELEMENT_INDEX;
|
||||
@@ -540,6 +547,13 @@ citytableEndElementHandle(void *userData, const char *name)
|
||||
|
||||
pData->curCityInfo.uiIndex = atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "cityName") == 0 && pData->curElement == CITYTABLE_ELEMENT_NAME)
|
||||
{
|
||||
// Copy this string into the pTownNames array
|
||||
mbstowcs(pTownNames[pData->curCityInfo.uiIndex], (const char *) pData->szCharData, MAX_TOWN_NAME_LENGHT);
|
||||
pTownNames[pData->curCityInfo.uiIndex][MAX_TOWN_NAME_LENGHT - 1] = 0;
|
||||
pData->curElement = CITYTABLE_ELEMENT_CITY;
|
||||
}
|
||||
else if(strcmp(name, "baseSector") == 0 && pData->curElement == CITYTABLE_ELEMENT_BASESECTOR)
|
||||
{
|
||||
pData->curElement = CITYTABLE_ELEMENT_CITY;
|
||||
|
||||
Reference in New Issue
Block a user