Fix: VS2010 debug builds crashed while reading InteractiveActions.xml

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8284 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2016-08-11 13:48:38 +00:00
parent f71e00ed78
commit 2c5e85f828
2 changed files with 20 additions and 16 deletions
+9 -9
View File
@@ -15,9 +15,9 @@
#ifdef JA2EDITOR
#ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.8281 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.8284 (Development Build)" };
#else
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.8281 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.8284 (Development Build)" };
#endif
// ------------------------------
@@ -27,11 +27,11 @@
//DEBUG BUILD VERSION
#ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.8281 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.8284 (Development Build)" };
#elif defined (JA113DEMO)
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.8281 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.8284 (Development Build)" };
#else
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.8281 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.8284 (Development Build)" };
#endif
#elif defined CRIPPLED_VERSION
@@ -46,16 +46,16 @@
//RELEASE BUILD VERSION
#ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.8281 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.8284 (Development Build)" };
#elif defined (JA113DEMO)
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.8281 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.8284 (Development Build)" };
#else
CHAR16 zVersionLabel[256] = { L"Release v1.13.8281 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Release v1.13.8284 (Development Build)" };
#endif
#endif
CHAR8 czVersionNumber[16] = { "Build 16.08.06" }; //YY.MM.DD
CHAR8 czVersionNumber[16] = { "Build 16.08.11" }; //YY.MM.DD
CHAR16 zTrackingNumber[16] = { L"Z" };
// SAVE_GAME_VERSION is defined in header, change it there
+11 -7
View File
@@ -116,14 +116,18 @@ interactiveactionsEndElementHandle( void *userData, const XML_Char *name )
// for whatever reasons the game crashes in VS2008 Release builds when copying over the tilevector
// this seems odd, as this works just fine in VS2010 and VS2013, and also works in VS205 debug builds
// for now, copy over the content by hand
pData->curArray[pData->curIndex].tileindexvector = tileindexvector;
pData->curArray[pData->curIndex].gridnovector = gridnovector;
// check if the vector is empty because assigning an empty vector will crash VS2010 debug builds!
if ( !tileindexvector.empty() )
{
pData->curArray[pData->curIndex].tileindexvector = tileindexvector;
tileindexvector.clear( );
}
tileindexvector.clear( );
tileindexvector.resize( 0 );
gridnovector.clear();
gridnovector.resize( 0 );
if ( !gridnovector.empty() )
{
pData->curArray[pData->curIndex].gridnovector = gridnovector;
gridnovector.clear();
}
}
pData->curIndex++;