Merged revision(s) 6971 from branches/ja2_source_official_2014:

Fix: MERC members accounts not displayed if they were at the end of the list


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6972 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2014-02-24 21:06:37 +00:00
parent 8cbdbf18b5
commit f00bc1aa14
+13 -32
View File
@@ -505,55 +505,36 @@ void DisplayHiredMercs()
UINT8 i, usMercID; UINT8 i, usMercID;
UINT8 ubFontColor; UINT8 ubFontColor;
UINT8 usMercIDStart; UINT8 usMercIDStart;
UINT8 usMercIDEnd; INT16 usCurrentRow = -1;
INT16 usCurrentRow = -1; INT16 merccounter = -1;
usPosY = MERC_AC_FIRST_ROW_Y + 3; usPosY = MERC_AC_FIRST_ROW_Y + 3;
// Start // Start
usMercIDStart = iCurrentAccountPage * MAX_NUMBER_MERCS_ON_PAGE; usMercIDStart = iCurrentAccountPage * MAX_NUMBER_MERCS_ON_PAGE;
// End
if ((usMercIDStart + MAX_NUMBER_MERCS_ON_PAGE) > (NUMBER_OF_MERCS - 1))
{
usMercIDEnd = (NUMBER_OF_MERCS - 1);
}
else
{
usMercIDEnd = usMercIDStart + MAX_NUMBER_MERCS_ON_PAGE;
}
// Flugente: neither do I, so screw this
// WANNE.LARRY: I don't understand why this is needed??? I did not change anything on this yet.
// At least second page
// This approach is needed, because auf LARRY_ROACHBURN
/*if (usMercIDStart > 0)
{
usMercIDStart++;
}*/
// Loop through all the mercs // Loop through all the mercs
for(i=usMercIDStart; i < usMercIDEnd/*(NUMBER_OF_MERCS - 1)*/ ; ++i) for(i=0; i < NUMBER_OF_MERCS ; ++i)
{ {
// We have no more free rows on the current page // Exit if this page is full
if (usCurrentRow == usMercIDEnd - 1) if (usCurrentRow >= MAX_NUMBER_MERCS_ON_PAGE - 1 )
break; break;
// WANNE: If we have drunken merc, then skip otherwise is will exist 2 times! // WANNE: If we have drunken merc, then skip otherwise is will exist 2 times!
if (gConditionsForMercAvailability[ i ].Drunk) if (gConditionsForMercAvailability[ i ].Drunk)
continue; continue;
// WANNE.LARRY
//if it larry Roach burn advance. ( cause larry is in twice, a sober larry and a stoned larry )
/*if( i == MERC_LARRY_ROACHBURN )
continue;*/
usMercID = GetMercIDFromMERCArray( i ); usMercID = GetMercIDFromMERCArray( i );
//is the merc on the team, or is owed money //is the merc on the team, or is owed money
if( IsMercOnTeam( (UINT8)usMercID ) || gMercProfiles[ usMercID ].iMercMercContractLength != 0 ) if( IsMercOnTeam( (UINT8)usMercID ) || gMercProfiles[ usMercID ].iMercMercContractLength != 0 )
{ {
usCurrentRow++; // count the number of mercs we really hired, but only display those that should be on this page
++merccounter;
if ( merccounter < usMercIDStart )
continue;
++usCurrentRow;
//if the merc is dead, make the color red, else white //if the merc is dead, make the color red, else white
if( IsMercDead( usMercID ) ) if( IsMercDead( usMercID ) )