Mercurial > mm7
changeset 1310:0665a061132b
autonotes and quest tables overflow fixed
author | Gloval |
---|---|
date | Mon, 24 Jun 2013 23:55:02 +0400 |
parents | 995d2f8ad71b |
children | 1dee26137a92 |
files | Autonotes.h GUIWindow.cpp NPC.cpp Party.cpp Party.h Player.cpp UI/UIBooks.cpp mm7_data.cpp mm7_data.h |
diffstat | 9 files changed, 115 insertions(+), 128 deletions(-) [+] |
line wrap: on
line diff
--- a/Autonotes.h Mon Jun 24 21:05:10 2013 +0600 +++ b/Autonotes.h Mon Jun 24 23:55:02 2013 +0400 @@ -22,4 +22,4 @@ AUTONOTE_TYPE eType; }; #pragma pack(pop) -extern std::array<Autonote, 195> pAutonoteTxt; // weak +extern std::array<Autonote, 196> pAutonoteTxt; // weak
--- a/GUIWindow.cpp Mon Jun 24 21:05:10 2013 +0600 +++ b/GUIWindow.cpp Mon Jun 24 23:55:02 2013 +0400 @@ -22,6 +22,7 @@ #include "StorylineTextTable.h" #include "Events2D.h" #include "UI\UIHouses.h" +#include "UI\UIBooks.h" #include "texts.h" #include "Autonotes.h" #include "Awards.h" @@ -432,14 +433,14 @@ unsigned int v19; // edi@43 unsigned int v20; // edi@45 void *v21; // esi@45 - signed int v23; // [sp+10h] [bp-5Ch]@38 + signed int max_beacons; // [sp+10h] [bp-5Ch]@38 char *v25; // [sp+14h] [bp-58h]@21 GUIWindow v26; // [sp+18h] [bp-54h]@8 v1 = this; pAudioPlayer->StopChannels(-1, -1); InitializeBookFonts(); - v1->CreateButton(0x1DBu, 0x1BDu, 0x9Eu, 0x22u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], 0); // Close + v1->CreateButton(475, 445, 158, 34, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], 0); // Close pCurrentScreen = SCREEN_BOOKS; num_achieved_awards_2 = 0; dword_506528 = 0; @@ -451,7 +452,7 @@ byte_506360 = 0; pTexture_CurrentBook = pIcons_LOD->LoadTexturePtr("lb_bordr", TEXTURE_16BIT_PALETTE); pTexture_LloydBeacons[0] = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); - pTexture_50635C = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); + pTexture_LloydBeacons[1] = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); pTex_tab_an_6b__zoom_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); pTex_tab_an_6a__zoom_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); @@ -459,40 +460,27 @@ pBtn_Book_2 = v1->CreateButton(415, 48, 39, 36, 1, 0, UIMSG_LloydsBeacon_FlippingBtn, 1, 0, pGlobalTXT_LocalizationStrings[523], 0); // Recall Beacon v17 = &pParty->pPlayers[_506348_current_lloyd_playerid]; - v23 = 1; - v18 = v17->pActiveSkills[14]; - if ( HIBYTE(v18) & 1 || (v18 & 0x80u) != 0 ) - { - v23 = 5; - } - else - { - if ( v18 & 0x40 ) - v23 = 3; - } - v19 = 0; - if ( v23 > 0 ) + + max_beacons = 1; + v18 = v17->pActiveSkills[PLAYER_SKILL_WATER]; + if ( v18 & 0x100 || (v18 & 0x80) ) + max_beacons = 5; + else if ( v18 & 0x40 ) + max_beacons = 3; + + + for (int i =0; i< max_beacons; ++i) + CreateButton(pLloydsBeaconsPreviewXs[v19], pLloydsBeaconsPreviewYs[v19], + 92, 68, 1, 180, UIMSG_InstallBeacon, i, 0, "", 0); + + for (int i =0; i< 5; ++i) { - do - { - v1->CreateButton(pLloydsBeaconsPreviewXs[v19], pLloydsBeaconsPreviewYs[v19], 0x5Cu, 0x44u, 1, 180, UIMSG_InstallBeacon, v19, 0, "", 0); - ++v19; - } - while ( (signed int)v19 < v23 ); + if (v17->pInstalledBeacons[i].uBeaconTime >= (signed __int64)pParty->uTimePlayed) + LoadThumbnailLloydTexture(i, _506348_current_lloyd_playerid + 1); + else + memset(&v17->pInstalledBeacons[i], 0, sizeof(LloydBeacon)); } - v20 = 0; - v21 = v17->pInstalledBeacons; - do - { - if ( *(_QWORD *)v21 >= (signed __int64)pParty->uTimePlayed ) - LoadThumbnailLloydTexture(v20, _506348_current_lloyd_playerid + 1); - else - memset(v21, 0, 0x1Cu); - ++v20; - v21 = (char *)v21 + 28; - } - while ( (signed int)v20 < 5 ); - } + } break; case WINDOW_TownPortal: @@ -507,13 +495,7 @@ for (uint i = 0; i < 6; ++i) v1->CreateButton(pTownPortalBook_xs[i], pTownPortalBook_ys[i], pTownPortalBook_ws[i], pTownPortalBook_hs[i], 1, 182, UIMSG_ClickTownInTP, i, 0, "", nullptr); - /*v16 = 0; - do - { - v1->CreateButton(pTownPortalBook_xs[v16], pTownPortalBook_ys[v16], pTownPortalBook_ws[v16], pTownPortalBook_hs[v16], 1, 182, 0xB7u, v16, 0, "", 0); - ++v16; - } - while ( (signed int)v16 < 6 );*/ + } break; @@ -537,11 +519,11 @@ memset(achieved_awards.data(), 0, 4000); for ( i = dword_506528; i < 512; ++i ) { - v14 = (char *)pQuestTable[i-1];//(&dword_722F10)[4 * i]; - if ( _449B57_test_bit(pParty->_quest_bits, i) && v14 ) + // v14 = (char *)pQuestTable[i];//(&dword_722F10)[4 * i]; + if ( _449B57_test_bit(pParty->_quest_bits, i) && pQuestTable[i] ) { - v15 = num_achieved_awards++; - achieved_awards[v15] = (AwardType)i; + achieved_awards[num_achieved_awards] = (AwardType)i; + ++num_achieved_awards; } } v12 = num_achieved_awards; @@ -572,35 +554,38 @@ pTexture_50636C = pIcons_LOD->LoadTexturePtr("tab-an-8b", TEXTURE_16BIT_PALETTE); pTexture_506368 = pIcons_LOD->LoadTexturePtr("tab-an-8a", TEXTURE_16BIT_PALETTE); - pBtn_Book_1 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, 50, 34, 1, 0, UIMSG_ClickBooksBtn, 11, 0, pGlobalTXT_LocalizationStrings[193], pTex_tab_an_6b__zoom_on, 0); - pBtn_Book_2 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, 50, 34, 1, 0, UIMSG_ClickBooksBtn, 10, 0, pGlobalTXT_LocalizationStrings[192], pTex_tab_an_7b__zoot_on, 0); - pBtn_Book_3 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, 50, 34, 1, 0, UIMSG_ClickBooksBtn, 2, 0, pGlobalTXT_LocalizationStrings[85], pTexture_506394, 0); // "Potion Notes" - pBtn_Book_4 = v1->CreateButton(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, 50, 34, 1, 0, UIMSG_ClickBooksBtn, 3, 0, pGlobalTXT_LocalizationStrings[137], pTexture_50638C, 0); // "Fountain Notes" - pBtn_Book_5 = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, 50, 34, 1, 0, UIMSG_ClickBooksBtn, 4, 0, pGlobalTXT_LocalizationStrings[8], pTexture_506384, 0); // "Obelisk Notes" - pBtn_Book_6 = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, 50, 34, 1, 0, UIMSG_ClickBooksBtn, 5, 0, pGlobalTXT_LocalizationStrings[141], pTexture_50637C, 0); // "Seer Notes" - pBtn_Autonotes_Misc = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, 50, 34, 1, 0, UIMSG_ClickBooksBtn, 6, 0, pGlobalTXT_LocalizationStrings[123], pTexture_506374, 0); // "Miscellaneous Notes" - pBtn_Autonotes_Instructors = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, 50, 34, 1, 0, UIMSG_ClickBooksBtn, 7, 0, pGlobalTXT_LocalizationStrings[662], pTexture_50636C, 0); // "Instructors" + pBtn_Book_1 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, 50, 34, 1, 0, + UIMSG_ClickBooksBtn, 11, 0, pGlobalTXT_LocalizationStrings[193], pTex_tab_an_6b__zoom_on, 0); + pBtn_Book_2 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, 50, 34, 1, 0, + UIMSG_ClickBooksBtn, 10, 0, pGlobalTXT_LocalizationStrings[192], pTex_tab_an_7b__zoot_on, 0); + pBtn_Book_3 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, 50, 34, 1, 0, + UIMSG_ClickBooksBtn, 2, 0, pGlobalTXT_LocalizationStrings[85], pTexture_506394, 0); // "Potion Notes" + pBtn_Book_4 = v1->CreateButton(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, 50, 34, 1, 0, + UIMSG_ClickBooksBtn, 3, 0, pGlobalTXT_LocalizationStrings[137], pTexture_50638C, 0); // "Fountain Notes" + pBtn_Book_5 = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, 50, 34, 1, 0, + UIMSG_ClickBooksBtn, 4, 0, pGlobalTXT_LocalizationStrings[8], pTexture_506384, 0); // "Obelisk Notes" + pBtn_Book_6 = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, 50, 34, 1, 0, + UIMSG_ClickBooksBtn, 5, 0, pGlobalTXT_LocalizationStrings[141], pTexture_50637C, 0); // "Seer Notes" + pBtn_Autonotes_Misc = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, 50, 34, 1, 0, + UIMSG_ClickBooksBtn, 6, 0, pGlobalTXT_LocalizationStrings[123], pTexture_506374, 0); // "Miscellaneous Notes" + pBtn_Autonotes_Instructors = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, 50, 34, 1, 0, + UIMSG_ClickBooksBtn, 7, 0, pGlobalTXT_LocalizationStrings[662], pTexture_50636C, 0); // "Instructors" - v9 = pBtn_Autonotes_Instructors; - v10 = dword_506528; num_achieved_awards = 0; - while ( v10 < 196 ) - { - if ( _506568_autonote_type == pAutonoteTxt[v10-1].eType)//dword_72371C[2 * v10] ) + for ( i = dword_506528; i < 196; ++i ) + if ( _506568_autonote_type == pAutonoteTxt[i].eType)//dword_72371C[2 * v10] ) { - //v25 = (&dword_723718_autonote_related)[8 * (signed __int16)v10]; - v25 = (char *)pAutonoteTxt[v10-1].pText; - if ( (short)v10 ) + if ( i ) { - if ( _449B57_test_bit(pParty->_autonote_bits, v10) && v25 ) + if ( _449B57_test_bit(pParty->_autonote_bits, i) && pAutonoteTxt[i].pText ) { - v11 = num_achieved_awards++; - achieved_awards[v11] = (AwardType)v10; + + achieved_awards[num_achieved_awards] = (AwardType)i; + ++num_achieved_awards; } } } - ++v10; - } + } break; @@ -621,12 +606,18 @@ pTexture_50637C = pIcons_LOD->LoadTexturePtr("tabWon", TEXTURE_16BIT_PALETTE); pTexture_506378 = pIcons_LOD->LoadTexturePtr("tabWoff", TEXTURE_16BIT_PALETTE); - pBtn_Book_1 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, 50, 34, 1, 0, UIMSG_ClickBooksBtn, 0, 0, pGlobalTXT_LocalizationStrings[251], pTex_tab_an_6b__zoom_on, 0);// "Zoom In" - pBtn_Book_2 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, 50, 34, 1, 0, UIMSG_ClickBooksBtn, 1, 0, pGlobalTXT_LocalizationStrings[252], pTex_tab_an_7b__zoot_on, 0);// "Zoom Out" - pBtn_Book_3 = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 113, 50, 34, 1, 0, UIMSG_ClickBooksBtn, 2, 0, pGlobalTXT_LocalizationStrings[192], (Texture *)"", 0);// Scroll Up - pBtn_Book_4 = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 150, 50, 34, 1, 0, UIMSG_ClickBooksBtn, 3, 0, pGlobalTXT_LocalizationStrings[193], (Texture *)"", 0);// Scroll Down - pBtn_Book_5 = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, 50, 34, 1, 0, UIMSG_ClickBooksBtn, 4, 0, pGlobalTXT_LocalizationStrings[573], (Texture *)"", 0);// "Scroll Right" - pBtn_Book_6 = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, 50, 34, 1, 0, UIMSG_ClickBooksBtn, 5, 0, pGlobalTXT_LocalizationStrings[572], (Texture *)"", 0);// "Scroll Left" + pBtn_Book_1 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, 50, 34, 1, 0, + UIMSG_ClickBooksBtn, 0, 0, pGlobalTXT_LocalizationStrings[251], pTex_tab_an_6b__zoom_on, 0);// "Zoom In" + pBtn_Book_2 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, 50, 34, 1, 0, + UIMSG_ClickBooksBtn, 1, 0, pGlobalTXT_LocalizationStrings[252], pTex_tab_an_7b__zoot_on, 0);// "Zoom Out" + pBtn_Book_3 = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 113, 50, 34, 1, 0, + UIMSG_ClickBooksBtn, 2, 0, pGlobalTXT_LocalizationStrings[192], (Texture *)"", 0);// Scroll Up + pBtn_Book_4 = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 150, 50, 34, 1, 0, + UIMSG_ClickBooksBtn, 3, 0, pGlobalTXT_LocalizationStrings[193], (Texture *)"", 0);// Scroll Down + pBtn_Book_5 = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, 50, 34, 1, 0, + UIMSG_ClickBooksBtn, 4, 0, pGlobalTXT_LocalizationStrings[573], (Texture *)"", 0);// "Scroll Right" + pBtn_Book_6 = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, 50, 34, 1, 0, + UIMSG_ClickBooksBtn, 5, 0, pGlobalTXT_LocalizationStrings[572], (Texture *)"", 0);// "Scroll Left" } break; @@ -649,8 +640,12 @@ pTex_tab_an_6a__zoom_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); pTex_tab_an_7a__zoot_off = pIcons_LOD->LoadTexturePtr("tab-an-7a", TEXTURE_16BIT_PALETTE); - pBtn_Book_1 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, pTex_tab_an_6b__zoom_on->uTextureWidth, pTex_tab_an_6b__zoom_on->uTextureHeight, 1, 0, UIMSG_ClickBooksBtn, 11, 0, pGlobalTXT_LocalizationStrings[192], pTex_tab_an_6b__zoom_on, 0); - pBtn_Book_2 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, pTex_tab_an_7b__zoot_on->uTextureHeight, pTex_tab_an_7b__zoot_on->uTextureHeight, 1, 0, UIMSG_ClickBooksBtn, 10, 0, pGlobalTXT_LocalizationStrings[193], pTex_tab_an_7b__zoot_on, 0); + pBtn_Book_1 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, + pTex_tab_an_6b__zoom_on->uTextureWidth, pTex_tab_an_6b__zoom_on->uTextureHeight, 1, 0, + UIMSG_ClickBooksBtn, 11, 0, pGlobalTXT_LocalizationStrings[192], pTex_tab_an_6b__zoom_on, 0); + pBtn_Book_2 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, pTex_tab_an_7b__zoot_on->uTextureHeight, + pTex_tab_an_7b__zoot_on->uTextureHeight, 1, 0, UIMSG_ClickBooksBtn, 10, 0, + pGlobalTXT_LocalizationStrings[193], pTex_tab_an_7b__zoot_on, 0); num_achieved_awards = 0; v26.uFrameX = 48;
--- a/NPC.cpp Mon Jun 24 21:05:10 2013 +0600 +++ b/NPC.cpp Mon Jun 24 23:55:02 2013 +0400 @@ -1181,36 +1181,36 @@ switch (decode_step) { case 1: - pAutonoteTxt[i].pText=RemoveQuotes(test_string); + pAutonoteTxt[i+1].pText=RemoveQuotes(test_string); break; case 2: { if ( !_stricmp(test_string, "potion")) { - pAutonoteTxt[i].eType = AUTONOTE_POTION_RECEPIE; + pAutonoteTxt[i+1].eType = AUTONOTE_POTION_RECEPIE; break; } if ( !_stricmp(test_string, "stat") ) { - pAutonoteTxt[i].eType = AUTONOTE_STAT_HINT; + pAutonoteTxt[i+1].eType = AUTONOTE_STAT_HINT; break; } if ( !_stricmp(test_string, "seer") ) { - pAutonoteTxt[i].eType = AUTONOTE_SEER; + pAutonoteTxt[i+1].eType = AUTONOTE_SEER; break; } if ( !_stricmp(test_string, "obelisk") ) { - pAutonoteTxt[i].eType = AUTONOTE_OBELISK; + pAutonoteTxt[i+1].eType = AUTONOTE_OBELISK; break; } if ( !_stricmp(test_string, "teacher") ) { - pAutonoteTxt[i].eType = AUTONOTE_TEACHER; + pAutonoteTxt[i+1].eType = AUTONOTE_TEACHER; break; } - pAutonoteTxt[i].eType =AUTONOTE_MISC; + pAutonoteTxt[i+1].eType =AUTONOTE_MISC; break; } } @@ -1242,7 +1242,7 @@ pQuestsTXT_Raw = NULL; pQuestsTXT_Raw = (char *)pEvents_LOD->LoadRaw("quests.txt", 0); strtok(pQuestsTXT_Raw, "\r"); - + memset(pQuestTable.data(),0, sizeof(pQuestTable)); for (i=0; i<512; ++i) { test_string = strtok(NULL, "\r") + 1; @@ -1264,7 +1264,7 @@ if (temp_str_len) { if ( decode_step == 1) - pQuestTable[i] =RemoveQuotes(test_string); + pQuestTable[i+1] =RemoveQuotes(test_string); } else {
--- a/Party.cpp Mon Jun 24 21:05:10 2013 +0600 +++ b/Party.cpp Mon Jun 24 23:55:02 2013 +0400 @@ -813,7 +813,7 @@ pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; // default character ui - stats uFlags = 0; - memset(_autonote_bits, 0, 12); + memset(_autonote_bits, 0, 26); memset(_quest_bits, 0, 64); memset(pIsArtifactFound, 0, 29); _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_RED_POTION_ACTIVE, 1);
--- a/Party.h Mon Jun 24 21:05:10 2013 +0600 +++ b/Party.h Mon Jun 24 23:55:02 2013 +0400 @@ -259,8 +259,8 @@ char uNumArenaLordWins; char pIsArtifactFound[29]; //7ba char field_7d7[39]; - unsigned char _autonote_bits[12]; - char field_80A[74]; + unsigned char _autonote_bits[26]; + char field_818[60]; char field_854[32]; int uNumArcomageWins; int uNumArcomageLoses;
--- a/Player.cpp Mon Jun 24 21:05:10 2013 +0600 +++ b/Player.cpp Mon Jun 24 23:55:02 2013 +0400 @@ -7893,11 +7893,11 @@ { if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & pParty->_autonote_bits[((signed __int16)var_value - 1) >> 3]) //&& (&dword_723718_autonote_related)[8 * a3] ) - && pAutonoteTxt[var_value-1].pText ) + && pAutonoteTxt[var_value].pText ) { v20 = pPlayers[currPlayerId + 1]; v20->PlaySound(SPEECH_96, 0); - v21 = pAutonoteTxt[var_value-1].eType;// dword_72371C[2 * a3]; + v21 = pAutonoteTxt[var_value].eType;// dword_72371C[2 * a3]; bFlashAutonotesBook = 1; _506568_autonote_type = v21; DrawPlayerBuffAnimBasedOnCondition(currPlayerId); @@ -7998,7 +7998,7 @@ case VAR_QBits_QuestsDone: if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & pParty->_quest_bits[((signed __int16)var_value - 1) >> 3]) // && (&dword_722F10)[4 * a3] ) - && pQuestTable[var_value-1] ) + && pQuestTable[var_value] ) { v14 = pPlayers[currPlayerId + 1]; bFlashQuestBook = 1; @@ -8425,7 +8425,7 @@ case VAR_QBits_QuestsDone: if ( !((unsigned __int8)(0x80u >> ((signed __int16)val - 1) % 8) & pParty->_quest_bits[((signed __int16)val - 1) >> 3]) //&& (&dword_722F10)[4 * val] ) - && pQuestTable[val-1] ) + && pQuestTable[val] ) { //v17 = pPlayers[uPlayerIdx + 1]; bFlashQuestBook = 1; @@ -8690,12 +8690,12 @@ } if ( !((unsigned __int8)(0x80u >> ((signed __int16)val - 1) % 8) & pParty->_autonote_bits[((signed __int16)val - 1) >> 3]) //&& (&dword_723718_autonote_related)[8 * val] ) - && pAutonoteTxt[val-1].pText ) + && pAutonoteTxt[val].pText ) { v23 = pPlayers[uPlayerIdx + 1]; v34 = 1; v23->PlaySound(SPEECH_96, 0); - v24 = pAutonoteTxt[val-1].eType;//dword_72371C[2 * val]; + v24 = pAutonoteTxt[val].eType;//dword_72371C[2 * val]; bFlashAutonotesBook = 1; _506568_autonote_type = v24; }
--- a/UI/UIBooks.cpp Mon Jun 24 21:05:10 2013 +0600 +++ b/UI/UIBooks.cpp Mon Jun 24 23:55:02 2013 +0400 @@ -7,7 +7,7 @@ #include "..\MM7.h" #include "..\Mouse.h" - +#include "UIBooks.h" #include "..\MapInfo.h" #include "..\GUIWindow.h" #include "..\GUIFont.h" @@ -27,8 +27,19 @@ +std::array<char *, 9> spellbook_texture_filename_suffices = {{"f", "a", "w", "e", "s", "m", "b", "l", "d"}}; // weak +//__int16 word_4E1D3A[777]; // weak +std::array<__int16, 6> pTownPortalBook_xs = {{260, 324, 147, 385, 390, 19}}; +std::array<__int16, 6> pTownPortalBook_ys = {{206, 84, 182, 239, 17, 283}}; +std::array<__int16, 6> pTownPortalBook_ws = {{ 80, 66, 68, 72, 67, 74}}; +std::array<__int16, 6> pTownPortalBook_hs = {{ 55, 56, 65, 67, 67, 59}}; +std::array<unsigned int, 5> pLloydsBeaconsPreviewXs = {{61, 281, 61, 281, 171}}; // 004E249C +std::array<unsigned int, 5> pLloydsBeaconsPreviewYs = {{84, 84, 228, 228, 155}}; +std::array<unsigned int, 5> pLloydsBeacons_SomeXs = {{59, 279, 59, 279, 169}}; +std::array<unsigned int, 5> pLloydsBeacons_SomeYs = {{82, 82, 226, 226, 153}}; + //----- (00411150) -------------------------------------------------------- @@ -664,8 +675,8 @@ { v4 = achieved_awards[v3]; ++num_achieved_awards; - v5 = pQuestTable[v4-1];//(&dword_722F10)[4 * v4]; - a1.DrawText(pAutonoteFont, 1, 0, ui_book_quests_text_color, pQuestTable[v4-1], 0, 0, 0);//(&dword_722F10)[4 * v4], 0, 0, 0); + v5 = pQuestTable[v4];//(&dword_722F10)[4 * v4]; + a1.DrawText(pAutonoteFont, 1, 0, ui_book_quests_text_color, pQuestTable[v4], 0, 0, 0);//(&dword_722F10)[4 * v4], 0, 0, 0); v6 = pAutonoteFont->CalcTextHeight(v5, &a1, 1, 0); v7 = a1.uFrameY + v6; if ( (signed int)(a1.uFrameY + v6) > (signed int)a1.uFrameHeight ) @@ -913,10 +924,10 @@ do { //if ( dword_72371C[2 * v8] == dword_506568 ) - if ( pAutonoteTxt[v8-1].eType == _506568_autonote_type ) + if ( pAutonoteTxt[v8].eType == _506568_autonote_type ) { //v32 = (&dword_723718_autonote_related)[8 * (signed __int16)v8]; - v32 = (char *)pAutonoteTxt[v8-1].pText; + v32 = (char *)pAutonoteTxt[v8].pText; if ( (short)v8 ) { if ( (unsigned __int16)_449B57_test_bit(pParty->_autonote_bits, v8) && v32 ) @@ -971,9 +982,9 @@ v13 = achieved_awards[v12]; ++num_achieved_awards; //v14 = (&dword_723718_autonote_related)[8 * v13]; - v14 = pAutonoteTxt[v13-1].pText; + v14 = pAutonoteTxt[v13].pText; //a1.DrawText(pAutonoteFont, 1, 0, 0, (&dword_723718_autonote_related)[8 * v13], 0, 0, 0); - a1.DrawText(pAutonoteFont, 1, 0, ui_book_autonotes_text_color, pAutonoteTxt[v13-1].pText, 0, 0, 0); + a1.DrawText(pAutonoteFont, 1, 0, ui_book_autonotes_text_color, pAutonoteTxt[v13].pText, 0, 0, 0); v15 = pAutonoteFont->CalcTextHeight(v14, &a1, 1, 0); v16 = a1.uFrameY + v15; if ( (signed int)(a1.uFrameY + v15) > (signed int)a1.uFrameHeight ) @@ -1259,15 +1270,15 @@ teal = (unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16; - v97 = (const void *)((unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16); + // v97 = (const void *)((unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16); - v32 = map_texture_16; + // v32 = map_texture_16; textr_width = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; stepY_r = (int)(signed __int64)((double)(- v84 - 22528 / (v5 / 384)+ 32768) / v30) << 16; - v81 = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30); + // v81 = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30); black = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30); - v76 = textr_width; + // v76 = textr_width; scaled_posY = stepY_r >> 16; //nearest neiborhood scaling if ( texture8_data)
--- a/mm7_data.cpp Mon Jun 24 21:05:10 2013 +0600 +++ b/mm7_data.cpp Mon Jun 24 23:55:02 2013 +0400 @@ -53,7 +53,7 @@ stru298 stru_50FE08; // weak #include "Autonotes.h" -std::array<Autonote, 195> pAutonoteTxt; // weak +std::array<Autonote, 196> pAutonoteTxt; // weak #include "Awards.h" std::array<Award, 105> pAwards; @@ -383,18 +383,7 @@ char aIcons[777]; // idb char aPending[777]; // idb char aCanTFindS[777]; // idb -std::array<char *, 9> spellbook_texture_filename_suffices = {{"f", "a", "w", "e", "s", "m", "b", "l", "d"}}; // weak -//__int16 word_4E1D3A[777]; // weak -std::array<__int16, 6> pTownPortalBook_xs = {{260, 324, 147, 385, 390, 19}}; -std::array<__int16, 6> pTownPortalBook_ys = {{206, 84, 182, 239, 17, 283}}; -std::array<__int16, 6> pTownPortalBook_ws = {{ 80, 66, 68, 72, 67, 74}}; -std::array<__int16, 6> pTownPortalBook_hs = {{ 55, 56, 65, 67, 67, 59}}; - -std::array<unsigned int, 5> pLloydsBeaconsPreviewXs = {{61, 281, 61, 281, 171}}; // 004E249C -std::array<unsigned int, 5> pLloydsBeaconsPreviewYs = {{84, 84, 228, 228, 155}}; -std::array<unsigned int, 5> pLloydsBeacons_SomeXs = {{59, 279, 59, 279, 169}}; -std::array<unsigned int, 5> pLloydsBeacons_SomeYs = {{82, 82, 226, 226, 153}}; std::array<char, 7> aSbwb00; // weak char aW[2]; // idb char aA[2]; // idb @@ -1284,7 +1273,7 @@ char *dword_721664; // idb std::array<NPCTopic, 789> pNPCTopics; char *dword_722F10; // idb -std::array<const char *, 512> pQuestTable; +std::array<const char *, 513> pQuestTable; _UNKNOWN unk_723714; // weak char *dword_723718_autonote_related; // idb int dword_72371C[777]; // weak
--- a/mm7_data.h Mon Jun 24 21:05:10 2013 +0600 +++ b/mm7_data.h Mon Jun 24 23:55:02 2013 +0400 @@ -333,15 +333,7 @@ extern char aCanTFindS[]; // idb extern std::array<char *, 9> spellbook_texture_filename_suffices; // weak extern __int16 word_4E1D3A[]; // weak -extern std::array<__int16, 6> pTownPortalBook_xs; -extern std::array<__int16, 6> pTownPortalBook_ys; -extern std::array<__int16, 6> pTownPortalBook_ws; -extern std::array<__int16, 6> pTownPortalBook_hs; -extern std::array<std::array<unsigned char, 12>, 9> pSpellbookSpellIndices; // 4E2430 from pSpellbookSpellIndices[9][12] -extern std::array<unsigned int, 5> pLloydsBeaconsPreviewXs; // 004E249C -extern std::array<unsigned int, 5> pLloydsBeaconsPreviewYs; -extern std::array<unsigned int, 5> pLloydsBeacons_SomeXs; -extern std::array<unsigned int, 5> pLloydsBeacons_SomeYs; // idb + extern std::array<char, 7> aSbwb00; // weak extern char aW[2]; // idb extern char aA[2]; // idb @@ -927,7 +919,7 @@ extern char *dword_721660; // idb extern char *dword_721664; // idb extern char *dword_722F10; // idb -extern std::array<const char *, 512> pQuestTable; +extern std::array<const char *, 513> pQuestTable; extern _UNKNOWN unk_723714; // weak extern char *dword_723718_autonote_related; // idb extern int dword_72371C[]; // weak