Fix: Finishing different types of militia training in the same sector could lead to only one notification and also paying for only that one while both did continue.

http://www.ja-galaxy-forum.com/ubbthreads.php/topics/336348/Re:_BUGZILLA_report_all_bugs_h#Post336348


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7538 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2014-10-01 14:54:51 +00:00
parent 3bdf06c62d
commit 384d0a36a4
+8 -5
View File
@@ -1450,22 +1450,24 @@ void HandleCompletionOfTownTrainingByGroupWithTrainer( SOLDIERTYPE *pTrainer, UI
}
// HEADROCK HAM 3.6: Separated Mobiles from Garrisons.
if ( ubMilitiaType == TOWN_MILITIA)
// silversurfer: We only want to set assignments done if it's the SAME assignment as the trainer's.
//if ( ubMilitiaType == TOWN_MILITIA)
if ( pTrainer->bAssignment == pSoldier->bAssignment )
{
if( ( pSoldier->bAssignment == TRAIN_TOWN ) && ( pSoldier->sSectorX == sSectorX )&&( pSoldier->sSectorY == sSectorY )&&( pSoldier->bSectorZ == bSectorZ ) )
if( /*( pSoldier->bAssignment == TRAIN_TOWN ) &&*/ ( pSoldier->sSectorX == sSectorX )&&( pSoldier->sSectorY == sSectorY )&&( pSoldier->bSectorZ == bSectorZ ) )
{
// done assignment
AssignmentDone( pSoldier, FALSE, FALSE );
}
}
else
/* else
{
if( ( pSoldier->bAssignment == TRAIN_MOBILE ) && ( pSoldier->sSectorX == sSectorX )&&( pSoldier->sSectorY == sSectorY )&&( pSoldier->bSectorZ == bSectorZ ) )
{
// done assignment
AssignmentDone( pSoldier, FALSE, FALSE );
}
}
}*/
}
@@ -1490,7 +1492,8 @@ void AddSectorForSoldierToListOfSectorsThatCompletedMilitiaTraining( SOLDIERTYPE
sCurrentSector = pCurrentSoldier->sSectorX + pCurrentSoldier->sSectorY * MAP_WORLD_X;
// is the merc's sector already in the list?
if( sCurrentSector == sSector )
// silversurfer: Doesn't matter if it's the same sector. We can have different assignments in the same sector so add the soldier to the list if he's on a different assignment.
if( sCurrentSector == sSector && pCurrentSoldier->bAssignment == pSoldier->bAssignment )
{
// already here
return;