fixed some crashes when loading 4xx built savegames. The game can continue, but You'll probably loose your vehicles. The Team in the Laptop/Personel also consist only of Your AVATAR, but in strategic map the team is complete.

This is not a very well finished fix. Only glued some NULL assigned pointers. I recomend to NOT load too old savegames.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@733 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sergeant_Kolja
2007-02-23 20:59:37 +00:00
parent a9059e3570
commit e40b062672
2 changed files with 18 additions and 1 deletions
+6
View File
@@ -3595,6 +3595,12 @@ BOOLEAN LoadStrategicAI( HWFILE hFile )
}
if( ubSAIVersion < 19 )
{
if( !gGarrisonGroup ) /* Sergeant Kolja, 2007-02-20: loading an older Qicksave, I crashed with NULL gGarrisonGroup[] */
{
gGarrisonGroup = (GARRISON_GROUP*)MemAlloc( sizeof( gOrigGarrisonGroup ) );
Assert( gGarrisonGroup );
memcpy( gGarrisonGroup, gOrigGarrisonGroup, sizeof( gOrigGarrisonGroup ) );
}
//Clear the garrison in C5
gArmyComp[ gGarrisonGroup[ SectorInfo[ SEC_C5 ].ubGarrisonID ].ubComposition ].bPriority = 0;
gArmyComp[ gGarrisonGroup[ SectorInfo[ SEC_C5 ].ubGarrisonID ].ubComposition ].bDesiredPopulation = 0;