Bugfix: When using a vehicle to move to an enemy sector mercs will force exit the vehicle. In this case the team panel sort order was random depending on which merc was last selected. This problem occurred because the sort function for the squad was not called for this scenario. It is now called whenever a merc is added to a squad.

Because of this the call for the sort function was removed from function SetAssignmentForList(). We do not need to call it twice.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7724 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2015-02-01 22:14:33 +00:00
parent 46b34e55d1
commit e4ef716d91
2 changed files with 8 additions and 3 deletions
+4 -2
View File
@@ -17094,7 +17094,9 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam )
//CHRISL: When setting mercs to a squad, resort the Squad list so we're in ubID order so team panel appears the same
// when switching between squads
switch( bAssignment )
// silversurfer: Shouldn't be necessary anymore because SortSquadByID() is now called whenever a merc is added to a squad by function AddCharacterToSquad().
// This is necessary because mercs can be added to squads by other functions as well and we always want to sort.
/* switch( bAssignment )
{
case( SQUAD_1 ):
case( SQUAD_2 ):
@@ -17118,7 +17120,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam )
case( SQUAD_20 ):
SortSquadByID(bAssignment);
break;
}
}*/
// check if we should start/stop flashing any mercs' assignment strings after these changes
+4 -1
View File
@@ -378,12 +378,15 @@ BOOLEAN AddCharacterToSquad( SOLDIERTYPE *pCharacter, INT8 bSquadValue )
pCharacter->bOldAssignment = bSquadValue;
}
// if current tactical sqaud...upadte panel
// if current tactical squad...update panel
if( NumberOfPeopleInSquad( ( INT8 )iCurrentTacticalSquad ) == 0 )
{
SetCurrentSquad( bSquadValue, TRUE );
}
// silversurfer: We need to sort the squad here. Otherwise it will have a random sort order when we force exit a vehicle in an enemy sector.
SortSquadByID(bSquadValue);
if( bSquadValue == ( INT8 ) iCurrentTacticalSquad )
{
CheckForAndAddMercToTeamPanel( Squad[ iCurrentTacticalSquad ][ bCounter ] );