- Fix: same militia profile is used several times in autoresolve

- Fix: sometimes no battle repoer is written for autoresolve
- Fix: no militia profile found in autoresolve due to bad sector

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8229 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-05-22 23:04:05 +00:00
parent 74bebdd454
commit db00927287
6 changed files with 44 additions and 7 deletions
+18 -2
View File
@@ -2526,7 +2526,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Autoresolve2");
else
{
// Flugente: take care of promotions and individual militia update
HandlePossibleMilitiaPromotion( gpCivs[i].pSoldier );
HandlePossibleMilitiaPromotion( gpCivs[i].pSoldier, TRUE );
}
TacticalRemoveSoldierPointer( gpCivs[ i ].pSoldier, FALSE );
@@ -5802,7 +5802,7 @@ void AutoResolveMilitiaDropAndPromote()
else if ( gpCivs[i].pSoldier->stats.bLife >= OKLIFE / 2 )
{
// Flugente: take care of promotions and individual militia update
HandlePossibleMilitiaPromotion( gpCivs[i].pSoldier );
HandlePossibleMilitiaPromotion( gpCivs[i].pSoldier, TRUE );
}
// DO NOT DELETE HERE!!!!
@@ -5810,4 +5810,20 @@ void AutoResolveMilitiaDropAndPromote()
//memset( &gpCivs[i], 0, sizeof(SOLDIERCELL) );
}
}
}
BOOLEAN IndividualMilitiaInUse_AutoResolve( UINT32 aMilitiaId )
{
if ( gpAR )
{
for ( INT32 i = 0; i < gpAR->ubCivs; ++i )
{
if ( gpCivs[i].pSoldier && aMilitiaId == gpCivs[i].pSoldier->usIndividualMilitiaID && IsLegalMilitiaId( gpCivs[i].pSoldier->usIndividualMilitiaID ) )
{
return TRUE;
}
}
}
return FALSE;
}