From 922d3e37c78c06aaac90a37e5620dd0b8ef6cc53 Mon Sep 17 00:00:00 2001 From: Shadooow Date: Mon, 21 Jun 2021 00:56:42 +0000 Subject: [PATCH] - fixed newly added merc to current squad not showing up in the panel interface - fixed dead mercs not showing up in the panel interface properly from loaded savegame git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9091 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Squads.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Tactical/Squads.cpp b/Tactical/Squads.cpp index 47f455c9..9bf4b2a7 100644 --- a/Tactical/Squads.cpp +++ b/Tactical/Squads.cpp @@ -389,7 +389,7 @@ BOOLEAN AddCharacterToSquad( SOLDIERTYPE *pCharacter, INT8 bSquadValue ) if( bSquadValue == ( INT8 ) iCurrentTacticalSquad ) { - CheckForAndAddMercToTeamPanel( Squad[ iCurrentTacticalSquad ][ bCounter ] ); + CheckForAndAddMercToTeamPanel( pCharacter ); } if ( pCharacter->ubID == gusSelectedSoldier ) @@ -911,6 +911,20 @@ BOOLEAN SetCurrentSquad( INT32 iCurrentSquad, BOOLEAN fForce ) CheckForAndAddMercToTeamPanel( Squad[ iCurrentTacticalSquad ][ iCounter ] ); } } + SOLDIERTYPE *pDeadSoldier = NULL; + for (iCounter = 0; iCounter < NUMBER_OF_SOLDIERS_PER_SQUAD; iCounter++) + { + if (sDeadMercs[iCurrentTacticalSquad][iCounter] != -1) + { + pDeadSoldier = FindSoldierByProfileID((UINT8)(sDeadMercs[iCurrentTacticalSquad][iCounter]), TRUE); + + if (pDeadSoldier) + { + // squad set, now add soldiers in + CheckForAndAddMercToTeamPanel(pDeadSoldier); + } + } + } } // check if the currently selected guy is on this squad, if not, get the first one on the new squad