- 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
This commit is contained in:
Shadooow
2021-06-21 00:56:42 +00:00
parent cf36b8c5d8
commit 922d3e37c7
+15 -1
View File
@@ -389,7 +389,7 @@ BOOLEAN AddCharacterToSquad( SOLDIERTYPE *pCharacter, INT8 bSquadValue )
if( bSquadValue == ( INT8 ) iCurrentTacticalSquad ) if( bSquadValue == ( INT8 ) iCurrentTacticalSquad )
{ {
CheckForAndAddMercToTeamPanel( Squad[ iCurrentTacticalSquad ][ bCounter ] ); CheckForAndAddMercToTeamPanel( pCharacter );
} }
if ( pCharacter->ubID == gusSelectedSoldier ) if ( pCharacter->ubID == gusSelectedSoldier )
@@ -911,6 +911,20 @@ BOOLEAN SetCurrentSquad( INT32 iCurrentSquad, BOOLEAN fForce )
CheckForAndAddMercToTeamPanel( Squad[ iCurrentTacticalSquad ][ iCounter ] ); 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 // check if the currently selected guy is on this squad, if not, get the first one on the new squad