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
This commit is contained in:
Wanne
2012-01-26 16:49:26 +00:00
parent 65814140d4
commit e39b43a956
+4
View File
@@ -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 );