From 384d0a36a4bc422f1fad1b194af33cca9090e570 Mon Sep 17 00:00:00 2001 From: silversurfer Date: Wed, 1 Oct 2014 14:54:51 +0000 Subject: [PATCH] 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 --- Strategic/Town Militia.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Strategic/Town Militia.cpp b/Strategic/Town Militia.cpp index 0892e4a22..8381d00f8 100644 --- a/Strategic/Town Militia.cpp +++ b/Strategic/Town Militia.cpp @@ -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;