Fix: Tag <BadSector> was overlooked in the r8295 change causing the game to crash on startup. This is now handled differently and properly.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8297 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2016-09-12 18:39:52 +00:00
parent 1e51250475
commit f1f0ba7aed
2 changed files with 20 additions and 17 deletions
+9 -9
View File
@@ -15,9 +15,9 @@
#ifdef JA2EDITOR #ifdef JA2EDITOR
#ifdef JA2UB #ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.8295 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.8297 (Development Build)" };
#else #else
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.8295 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.8297 (Development Build)" };
#endif #endif
// ------------------------------ // ------------------------------
@@ -27,11 +27,11 @@
//DEBUG BUILD VERSION //DEBUG BUILD VERSION
#ifdef JA2UB #ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.8295 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.8297 (Development Build)" };
#elif defined (JA113DEMO) #elif defined (JA113DEMO)
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.8295 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.8297 (Development Build)" };
#else #else
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.8295 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Debug: v1.13.8297 (Development Build)" };
#endif #endif
#elif defined CRIPPLED_VERSION #elif defined CRIPPLED_VERSION
@@ -46,16 +46,16 @@
//RELEASE BUILD VERSION //RELEASE BUILD VERSION
#ifdef JA2UB #ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.8295 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.8297 (Development Build)" };
#elif defined (JA113DEMO) #elif defined (JA113DEMO)
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.8295 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.8297 (Development Build)" };
#else #else
CHAR16 zVersionLabel[256] = { L"Release v1.13.8295 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Release v1.13.8297 (Development Build)" };
#endif #endif
#endif #endif
CHAR8 czVersionNumber[16] = { "Build 16.09.11" }; //YY.MM.DD CHAR8 czVersionNumber[16] = { "Build 16.09.12" }; //YY.MM.DD
CHAR16 zTrackingNumber[16] = { L"Z" }; CHAR16 zTrackingNumber[16] = { L"Z" };
// SAVE_GAME_VERSION is defined in header, change it there // SAVE_GAME_VERSION is defined in header, change it there
+11 -8
View File
@@ -41,6 +41,7 @@ typedef enum
SMCTABLE_ELEMENT_TRAVELRATING, SMCTABLE_ELEMENT_TRAVELRATING,
SMCTABLE_ELEMENT_TRAVELTYPE, SMCTABLE_ELEMENT_TRAVELTYPE,
SMCTABLE_ELEMENT_SHORTNAME, SMCTABLE_ELEMENT_SHORTNAME,
SMCTABLE_ELEMENT_BADSECTOR,
} SMCTABLE_PARSE_STAGE; } SMCTABLE_PARSE_STAGE;
typedef struct typedef struct
@@ -137,7 +138,7 @@ smctableStartElementHandle(void *userData, const XML_Char *name, const XML_Char
} }
else if(strcmp(name, "BadSector") == 0 && pData->curElement == SMCTABLE_ELEMENT_SECTOR) else if(strcmp(name, "BadSector") == 0 && pData->curElement == SMCTABLE_ELEMENT_SECTOR)
{ {
pData->curElement = SMCTABLE_ELEMENT_TRAVELTYPE; pData->curElement = SMCTABLE_ELEMENT_BADSECTOR;
pData->maxReadDepth++; //we are not skipping this element pData->maxReadDepth++; //we are not skipping this element
} }
pData->szCharData[0] = '\0'; pData->szCharData[0] = '\0';
@@ -323,8 +324,8 @@ smctableEndElementHandle(void *userData, const XML_Char *name)
} }
else else
{ {
// silversurfer: don't just assign type GROUNDBARRIER. Let modders know that the data is incorrect! // silversurfer: don't just assign type GROUNDBARRIER. Let modders know that traversal data is incorrect!
AssertMsg(0, String( "Incorrect traversal data '%s' for sector row=%d column=%d !", pData->szCharData, pData->uiRowNumber, pData->uiColNumber) ); AssertMsg(0, String( "Incorrect traversal data '%s' for sector row=%d column=%d in MovementCosts.xml!", pData->szCharData, pData->uiRowNumber, pData->uiColNumber) );
//trav_type = GROUNDBARRIER; //trav_type = GROUNDBARRIER;
} }
// Now assign it to the correct directory using the close tag as a guide // Now assign it to the correct directory using the close tag as a guide
@@ -348,11 +349,6 @@ smctableEndElementHandle(void *userData, const XML_Char *name)
{ {
pData->travHere = trav_type; pData->travHere = trav_type;
} }
else if(strcmp(name, "BadSector") == 0)
{
bool fBadSector = atoi(pData->szCharData) > 0;
sBadSectorsList[pData->uiColNumber][pData->uiRowNumber] = fBadSector;
}
else else
{ {
// Bogus Traversal Reference // Bogus Traversal Reference
@@ -362,6 +358,13 @@ smctableEndElementHandle(void *userData, const XML_Char *name)
//fprintf (outfile, "Exiting Traversal Type\n"); //fprintf (outfile, "Exiting Traversal Type\n");
pData->curElement = SMCTABLE_ELEMENT_SECTOR; pData->curElement = SMCTABLE_ELEMENT_SECTOR;
} }
else if(pData->curElement == SMCTABLE_ELEMENT_BADSECTOR)
{
bool fBadSector = atoi(pData->szCharData) > 0;
sBadSectorsList[pData->uiColNumber][pData->uiRowNumber] = fBadSector;
pData->curElement = SMCTABLE_ELEMENT_SECTOR;
}
//else if(strcmp(name, "Shortname") == 0 && pData->curElement == SMCTABLE_ELEMENT_SHORTNAME) //else if(strcmp(name, "Shortname") == 0 && pData->curElement == SMCTABLE_ELEMENT_SHORTNAME)
//{ //{
// // Copy this string into the pTownNames array // // Copy this string into the pTownNames array