From e39b43a9561ad75e4a54b1fa68d6edc54e095720 Mon Sep 17 00:00:00 2001 From: Wanne Date: Thu, 26 Jan 2012 16:49:26 +0000 Subject: [PATCH] Bugfix: Fixed crash when entering a sector in tactical and the rotting corpses from the temporary file has an invalid high value -> just set rotting corpses to 0 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4894 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Tactical Save.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tactical/Tactical Save.cpp b/Tactical/Tactical Save.cpp index e4bc7a46..9c6a04d6 100644 --- a/Tactical/Tactical Save.cpp +++ b/Tactical/Tactical Save.cpp @@ -1741,6 +1741,10 @@ BOOLEAN LoadRottingCorpsesFromTempCorpseFile( INT16 sMapX, INT16 sMapY, INT8 bMa FileClose( hFile ); return( FALSE ); } + + // WANNE: If we get wrong data (very high value) from the temp file, we assume we have wrong value and therefore set corpses to 0 which will not crash the game! + if (uiNumberOfCorpses > 10000) + uiNumberOfCorpses = 0; // Get town ID for use later.... bTownId = GetTownIdForSector( gWorldSectorX, gWorldSectorY );