Merged revision(s) 7798 from branches/ja2_source_official_2014:

Fix: Due to unknown circumstances, a GROUP's waypoints can be corrupted. This will cause incorrect movement and can crash the game. As we have no way of knowing where the group was supposed to move, we instead delete the waypoints and stop moving.

This does NOT fix the initial corruption of waypoints. That is a very troubling error that should be fixed ASAP!

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7800 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2015-03-29 15:44:26 +00:00
parent 6891d102c3
commit 01bdeb2c7f
2 changed files with 20 additions and 9 deletions
+9 -9
View File
@@ -15,9 +15,9 @@
#ifdef JA2EDITOR
#ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.7646 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.7800 (Development Build)" };
#else
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.7646 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.7800 (Development Build)" };
#endif
// ------------------------------
@@ -27,11 +27,11 @@
//DEBUG BUILD VERSION
#ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.7646 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.7800 (Development Build)" };
#elif defined (JA113DEMO)
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.7646 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.7800 (Development Build)" };
#else
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.7646 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.7800 (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.7646 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.7800 (Development Build)" };
#elif defined (JA113DEMO)
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.7646 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.7800 (Development Build)" };
#else
CHAR16 zVersionLabel[256] = { L"Release v1.13.7646 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Release v1.13.7800 (Development Build)" };
#endif
#endif
CHAR8 czVersionNumber[16] = { "Build 14.11.3" }; //YY.MM.DD
CHAR8 czVersionNumber[16] = { "Build 15.03.29" }; //YY.MM.DD
CHAR16 zTrackingNumber[16] = { L"Z" };
// SAVE_GAME_VERSION is defined in header, change it there
+11
View File
@@ -2712,6 +2712,17 @@ void InitiateGroupMovementToNextSector( GROUP *pGroup )
// the sector we are currently in
ubSector = (UINT8)SECTOR( pGroup->ubSectorX, pGroup->ubSectorY );
// Flugente: for unknown reasons, it is possible for waypoints to be filled with complete garbage. In this case we cannot use them.
// As we have no idea as to where this group was originally intended to go, and wandering around aimlessly would potentially be bad, we just stop moving...
if ( wp->x < 1 || wp->x > 16 || wp->y < 1 || wp->y > 16 )
{
ScreenMsg( FONT_YELLOW, MSG_ERROR, L"Group %d has corrupted waypoints. Cancelling movement!", pGroup->ubGroupID );
RemovePGroupWaypoints( pGroup );
return;
}
//We now have the correct waypoint.
//Analyse the group and determine which direction it will move from the current sector.
dx = wp->x - pGroup->ubSectorX;