diff UIHouses.cpp @ 878:6f32de715e30

Merge
author Nomad
date Mon, 01 Apr 2013 16:44:33 +0200
parents 231523a39203
children 1d7e7d61485b
line wrap: on
line diff
--- a/UIHouses.cpp	Mon Apr 01 14:58:02 2013 +0200
+++ b/UIHouses.cpp	Mon Apr 01 16:44:33 2013 +0200
@@ -388,7 +388,7 @@
       if (~npc->uFlags & 0x80)
         //if ( !(*(char *)v6 & 0x80) )
       {
-        v7 = uNumDialogueNPCPortraits++ - dword_591080 ? 1 : 0;
+        v7 = uNumDialogueNPCPortraits++ - (dword_591080 != 0) ? 1 : 0;
         HouseNPCData[v7] = npc;
         //v6 = v17;
         //*(&v13 + v2) = *(v17 - 1);
@@ -4595,7 +4595,7 @@
     void GuildDialog()
         {
         GUIWindow *v0; // ebx@1
-        Player *currPlayer; // edi@1
+        //Player *currPlayer; // edi@1
         signed int base_teach_price; // ebx@1
         int v3; // edi@6
         int result; // eax@11
@@ -4652,17 +4652,17 @@
         int v55; // [sp+2C8h] [bp-24h]@47
         int main_text_color; // [sp+2CCh] [bp-20h]@1
         int hi_text_color; // [sp+2D0h] [bp-1Ch]@1
-        Player *v58; // [sp+2D4h] [bp-18h]@1
+        //Player *v58; // [sp+2D4h] [bp-18h]@1
         unsigned __int8 uPlayerID; // [sp+2DBh] [bp-11h]@31
         char *Str; // [sp+2DCh] [bp-10h]@35
         int v61; // [sp+2E0h] [bp-Ch]@35
         unsigned int v62; // [sp+2E4h] [bp-8h]@13
         int v63; // [sp+2E8h] [bp-4h]@1
 
-        v0 = window_SpeakInHouse;
+        v0 = window_SpeakInHouse;//Ritor1: in process
         memcpy(&working_window, window_SpeakInHouse, sizeof(GUIWindow));
-        v58 = pPlayers[uActiveCharacter];
-        currPlayer = v58;
+        //v58 = pPlayers[uActiveCharacter];
+        //currPlayer = pPlayers[uActiveCharacter];
         working_window.uFrameX = 483;
         working_window.uFrameWidth = 148;
         working_window.uFrameZ = 334;
@@ -4670,7 +4670,7 @@
         hi_text_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
         //v2 = (signed __int64)(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C] * 500.0);
         base_teach_price = (signed __int64)(p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier * 500.0);
-        v63 = base_teach_price * (100 - currPlayer->GetMerchant()) / 100;
+        v63 = base_teach_price * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
         if ( v63 < base_teach_price / 3 )
             v63 = base_teach_price / 3;
         strcpy(Dest, "");
@@ -4680,12 +4680,12 @@
         strcpy(v49, "");
         if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
             {
-            if ( dialog_menu_id != HOUSE_DIALOGUE_GULD_BUY_BOOKS ) //buy skill
+            if ( dialog_menu_id != HOUSE_DIALOGUE_GUILD_BUY_BOOKS ) //buy skill
                 {
                 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
                     {
                     //v3 = (int)(&currPlayer->uIntelligence + dword_F8B19C); //test skill
-                    if ( v58->pActiveSkills[dialog_menu_id-36] )
+                    if ( pPlayers[uActiveCharacter]->pActiveSkills[dialog_menu_id-36] )
                         {
                         sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[403], pClassNames[dialog_menu_id - 16]); //"You already know the %s skill"
                         ShowStatusBarString(pTmpBuf, 2u);
@@ -4701,7 +4701,7 @@
                         else
                             {
                             Party::TakeGold(v63);
-                            v58->pActiveSkills[dialog_menu_id-36] = 1;
+                            pPlayers[uActiveCharacter]->pActiveSkills[dialog_menu_id-36] = 1;
                             }
                         }
                     }
@@ -4721,7 +4721,7 @@
                     {
                     pRenderer->DrawTextureTransparent(v63, 0x5Au, ItemsInShopTexture[v6]);
                     ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), ItemsInShopTexture[v6], v6 + 1);
-                    currPlayer = v58;
+                    //currPlayer = v58;
                     }
                 v63 += 70;
                 v62 += 280;
@@ -4739,7 +4739,7 @@
                         {
                         pRenderer->DrawTextureTransparent(v63, 0xFAu, ItemsInShopTexture[v7]);
                         ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), ItemsInShopTexture[v7], v7 + 1);
-                        currPlayer = v58;
+                        //currPlayer = v58;
                         }
                     v63 += 70;
                     v62 += 280;
@@ -4785,7 +4785,7 @@
                                 v15 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v13 + 12 * (int)v14));
                                 v16 = (int)window_SpeakInHouse->ptr_1C;
                                 uPlayerID = uActiveCharacter - 1;
-                                v17 = currPlayer->_490EEE( (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)v14, 3, v16,  2);
+                                v17 = pPlayers[uActiveCharacter]->_490EEE( (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)v14, 3, v16,  2);
                                 v18 = BuilDialogueString((char *)pMerchantsBuyPhrases[v17], uPlayerID, v15, (char *)v14, 2, 0);     
                                 v19 = pFontArrus->CalcTextHeight(v18, &working_window, 0, 0);
                                 working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138,  main_text_color, v18, 3);
@@ -4795,7 +4795,7 @@
                     return;
             }
         if ( !(unsigned __int16)_449B57_test_bit(
-            (unsigned __int8 *)currPlayer->_guilds_member_bits,
+            (unsigned __int8 *)pPlayers[uActiveCharacter]->_guilds_member_bits,
             guild_mambership_flags[(unsigned int)window_SpeakInHouse->ptr_1C-139]) )
             { //you must me member
             v38 = pFontArrus->CalcTextHeight(pNPCTopics[121].pText, &working_window, 0, 0);
@@ -4834,7 +4834,7 @@
             else
                 {
 
-                if((byte_4ED970_skill_learn_ability_by_class_table[v58->classType][v23-36])&&(v58->pActiveSkills[v23-36]))
+                if((byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v23-36])&&(pPlayers[uActiveCharacter]->pActiveSkills[v23-36]))
                     // or
                     //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
                     {
@@ -4850,7 +4850,7 @@
             if ( !v61 )
                 {
 LABEL_64:
-                sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v58->pName, pClassNames[v58->classType]); // "Seek knowledge elsewhere %s the %s"	
+                sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]); // "Seek knowledge elsewhere %s the %s"	
                 strcat(pTmpBuf, "\n \n");
                 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
                 v19 = pFontArrus->CalcTextHeight(pTmpBuf, &working_window, 0, 0);
@@ -4882,7 +4882,7 @@
                     //  __debugbreak();
                     //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
                     // or
-                    if ((byte_4ED970_skill_learn_ability_by_class_table[v58->classType][v29 - 36])&&(v58->pActiveSkills[v29-36]))
+                    if ((byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v29 - 36])&&(pPlayers[uActiveCharacter]->pActiveSkills[v29-36]))
                         // or
                         //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]