diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index d86439b6..b0012dbb 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -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 diff --git a/Tactical/Squads.cpp b/Tactical/Squads.cpp index 8e6c1424..462448ca 100644 --- a/Tactical/Squads.cpp +++ b/Tactical/Squads.cpp @@ -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 ] );