BUGZILLA #549: Fixed mercs not showing up on MERC website

o Workaround for old bugged savegames: If passed day 30, make merc available on MERC website
o Fixed problems with merc not showing up after Larry was added
o Fixed white background graphic when MERC website is down (broken link)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4583 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2011-07-21 16:38:11 +00:00
parent 9630f0f21f
commit 20e1e49964
4 changed files with 39 additions and 7 deletions
+3 -2
View File
@@ -20,10 +20,11 @@ extern CHAR16 zTrackingNumber[16];
//
// Keeps track of the saved game version. Increment the saved game version whenever
// you will invalidate the saved game file
#define SAVE_GAME_VERSION 122 //114 //113 //112 //111 //110 //109 //108 //107 //106 //105 //104 //103 //102 //101 //100 // 99
#define SAVE_GAME_VERSION 123 //114 //113 //112 //111 //110 //109 //108 //107 //106 //105 //104 //103 //102 //101 //100 // 99
#define CURRENT_SAVEGAME_DATATYPE_VERSION 122
#define CURRENT_SAVEGAME_DATATYPE_VERSION 123
#define FIXED_MERC_NOT_AVAILABLE_ON_MERC_WEBSITE 123 // Before this, only Bubba was available on MERC website
#define FIXED_CREPITUS_IN_REALISTIC_GAME_MODE 122 // Before this, there was an initializing problem in GameInit.lua on startup, in which we could meet crepitus in Tixa underground map
#define FIXED_NPC_QUOTE_BUG 121 // Before this, we need to reload all npc quote information because it was not being saved and loaded correctly.
#define MOVED_GENERAL_INFO 120 // Before this, general game information was saved much later in the save game process.
+1 -1
View File
@@ -61,7 +61,7 @@ void RenderBrokenLink()
void DrawBrokenLinkWhiteBackground()
{
ColorFillVideoSurfaceArea( FRAME_BUFFER, LAPTOP_SCREEN_UL_X, LAPTOP_SCREEN_WEB_UL_Y, LAPTOP_SCREEN_LR_X, LAPTOP_SCREEN_WEB_LR_Y, Get16BPPColor( FROMRGB( 255, 255, 255) ) );
ColorFillVideoSurfaceArea( FRAME_BUFFER, LAPTOP_SCREEN_UL_X, LAPTOP_SCREEN_WEB_UL_Y, LAPTOP_SCREEN_LR_X, LAPTOP_SCREEN_WEB_LR_Y - 55, Get16BPPColor( FROMRGB( 255, 255, 255) ) );
}
+13 -4
View File
@@ -2536,18 +2536,27 @@ void NewMercsAvailableAtMercSiteCallBack( )
for(UINT8 i=0; i<NUM_PROFILES; i++)
{
if ( gConditionsForMercAvailability[i].ProfilId != 0 && gConditionsForMercAvailability[i].NewMercsAvailable == FALSE && gConditionsForMercAvailability[i].StartMercsAvailable == FALSE )
{
gConditionsForMercAvailability[i].NewMercsAvailable = TRUE;
{
if( CanMercBeAvailableYet( gConditionsForMercAvailability[i].uiIndex ) )
{
gConditionsForMercAvailability[i].NewMercsAvailable = TRUE;
if ( gConditionsForMercAvailability[ gConditionsForMercAvailability[i].uiIndex ].Drunk == TRUE )
{
LaptopSaveInfo.gubLastMercIndex = gConditionsForMercAvailability[gConditionsForMercAvailability[i].uiAlternateIndex].uiIndex;
}
else
{
LaptopSaveInfo.gubLastMercIndex++;
// If Previous merc has alternate index
if (i > 0 && gConditionsForMercAvailability[ gConditionsForMercAvailability[i - 1].uiIndex ].uiAlternateIndex != 255)
{
// Previous merc has alternate (drunk) merc, skip his one!
LaptopSaveInfo.gubLastMercIndex = LaptopSaveInfo.gubLastMercIndex + 2;
}
else
{
LaptopSaveInfo.gubLastMercIndex++;
}
}
gConditionsForMercAvailability[gConditionsForMercAvailability[i].uiIndex].NewMercsAvailable = TRUE;
+22
View File
@@ -5058,6 +5058,28 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
}
}
}
// WANNE: There were some problems in older savegames, that the MERC are not available on the merc site. Just recalculate the correct number of mercs
// Players that have a bugged savegame and are above Day 50 get ALL Merc on the website!
if(guiCurrentSaveGameVersion < FIXED_MERC_NOT_AVAILABLE_ON_MERC_WEBSITE)
{
// WORKAROUND: If player passed day 30, make merc available on MERC website!
if (LaptopSaveInfo.gubLastMercIndex <= 6 && GetWorldDay() >= 30)
{
LaptopSaveInfo.gubLastMercIndex = 0;
for(UINT8 i=0; i<NUM_PROFILES; i++)
{
if ( gConditionsForMercAvailability[i].ProfilId != 0 && (gConditionsForMercAvailability[i].NewMercsAvailable == TRUE || gConditionsForMercAvailability[i].StartMercsAvailable == TRUE ))
{
LaptopSaveInfo.gubLastMercIndex ++;
}
}
if (LaptopSaveInfo.gubLastMercIndex > 0)
LaptopSaveInfo.gubLastMercIndex = LaptopSaveInfo.gubLastMercIndex - 1;
}
}
// ---------------------------------------------------------------------------