changeset 1628:7ce831a2a393

m
author Ritor1
date Mon, 16 Sep 2013 09:37:08 +0600
parents 361b63797bdf
children 2149b14614ad
files UI/UIHouses.cpp
diffstat 1 files changed, 36 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/UI/UIHouses.cpp	Fri Sep 13 10:10:53 2013 +0600
+++ b/UI/UIHouses.cpp	Mon Sep 16 09:37:08 2013 +0600
@@ -2834,8 +2834,8 @@
 //----- (004B705E) --------------------------------------------------------
 void TempleDialog()
     {
-    GUIWindow *v0; // ebx@1
-    Player *v1; // esi@1
+    //GUIWindow *v0; // ebx@1
+    //Player *v1; // esi@1
     int v2; // edi@1
     int result; // eax@4
     GUIWindow *v4; // edi@6
@@ -2899,16 +2899,16 @@
     unsigned int v65; // [sp+1BCh] [bp-8h]@6
     DDM_DLV_Header *v66; // [sp+1C0h] [bp-4h]@6
 
-    v0 = window_SpeakInHouse;
+    //v0 = window_SpeakInHouse;
     memcpy(&v57, window_SpeakInHouse, sizeof(v57));
     v57.uFrameX = 483;
     v57.uFrameWidth = 148;
     v57.uFrameZ = 334;
     HIDWORD(v58) = TargetColor(0xFFu, 0xFFu, 0xFFu);
     HIDWORD(v59) = TargetColor(0xFFu, 0xFFu, 0x9Bu);
-    v1 = pPlayers[uActiveCharacter];
+    //v1 = pPlayers[uActiveCharacter];
     //v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C]);
-    v2 = pPlayers[uActiveCharacter]->GetTempleHealCostModifier(p2DEvents[v0->par1C - 1].fPriceMultiplier);
+    v2 = pPlayers[uActiveCharacter]->GetTempleHealCostModifier(p2DEvents[window_SpeakInHouse->par1C - 1].fPriceMultiplier);
     HIDWORD(v60) = v2;
     if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
     {
@@ -2926,7 +2926,7 @@
               v66 = 0;
               //v65 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v5] * 500.0);
               v65 = (signed __int64)(p2DEvents[(signed int)v5 - 1].flt_24 * 500.0);
-              v6 = v1->GetMerchant();
+              v6 = pPlayers[uActiveCharacter]->GetMerchant();
               v64 = (signed int)(v65 * (100 - v6)) / 100;
               if ( v64 < (signed int)v65 / 3 )
                 v64 = (signed int)v65 / 3;
@@ -2939,7 +2939,7 @@
               do
               {
                 v9 = v4->GetControl(v62)->msg_param - 36;
-                if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType][v9] && !v1->pActiveSkills[v9] )
+                if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v9] && !pPlayers[uActiveCharacter]->pActiveSkills[v9] )
                 {
                   v10 = pFontArrus->CalcTextHeight(pSkillNames[v9], &v57, 0, 0);
                   v66 = (DDM_DLV_Header *)((char *)v66 + v10);
@@ -2969,7 +2969,7 @@
                     v14 = v12->GetControl(v62);
                     v15 = v14;
                     v16 = v14->msg_param - 36;
-                    if ( !byte_4ED970_skill_learn_ability_by_class_table[v1->classType][v16] || v1->pActiveSkills[v16] )
+                    if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v16] || pPlayers[uActiveCharacter]->pActiveSkills[v16] )
                     {
                       v15->uW = 0;
                       v15->uHeight = 0;
@@ -3003,7 +3003,7 @@
               else
               {
 LABEL_78:
-                sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
+                sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);
                 strcat(pTmpBuf.data(), "\n \n");
                 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
                 v22 = WORD2(v59);
@@ -3070,7 +3070,7 @@
                         }
                     }
                 ++byte_F8B1EF[uActiveCharacter];
-                v1->PlaySound(SPEECH_83, 0);
+                pPlayers[uActiveCharacter]->PlaySound(SPEECH_83, 0);
                 ShowStatusBarString(pGlobalTXT_LocalizationStrings[527], 2u); // "Thank You!"
                 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
                 return;
@@ -3080,7 +3080,7 @@
           pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
           return;
         }
-        if ( !v1->IsPlayerHealableByTemple() )
+        if ( !pPlayers[uActiveCharacter]->IsPlayerHealableByTemple() )
             return;
         v25 = 0;
         if ( pParty->uNumGold < v2 )
@@ -3091,27 +3091,27 @@
           return;
         }
         Party::TakeGold(v2);
-        v35 = LODWORD(v1->pConditions[17]);
-        v59 = v1->pConditions[14];
-        v58 = v1->pConditions[15];
-        v60 = v1->pConditions[16];
-        v61 = (GUIWindow *)HIDWORD(v1->pConditions[17]);
-        memset(v1, 0, 0xA0u);
-        v1->sHealth = v1->GetMaxHealth();
-        v1->sMana = v1->GetMaxMana();
+        v35 = LODWORD(pPlayers[uActiveCharacter]->pConditions[17]);
+        v59 = pPlayers[uActiveCharacter]->pConditions[14];
+        v58 = pPlayers[uActiveCharacter]->pConditions[15];
+        v60 = pPlayers[uActiveCharacter]->pConditions[16];
+        v61 = (GUIWindow *)HIDWORD(pPlayers[uActiveCharacter]->pConditions[17]);
+        memset(pPlayers[uActiveCharacter], 0, 0xA0u);
+        pPlayers[uActiveCharacter]->sHealth = pPlayers[uActiveCharacter]->GetMaxHealth();
+        pPlayers[uActiveCharacter]->sMana = pPlayers[uActiveCharacter]->GetMaxMana();
         v36 = (signed int)window_SpeakInHouse->ptr_1C;
         if ( v36 != 78 && (v36 <= 80 || v36 > 82) )
             {
             if ( (unsigned int)v61 | v35 )
                 {
-                v37 = LOBYTE(v1->uPrevFace);
-                v38 = v1->uPrevVoiceID;
-                v1->uCurrentFace = v37;
-                v1->uVoiceID = v38;
+                v37 = LOBYTE(pPlayers[uActiveCharacter]->uPrevFace);
+                v38 = pPlayers[uActiveCharacter]->uPrevVoiceID;
+                pPlayers[uActiveCharacter]->uCurrentFace = v37;
+                pPlayers[uActiveCharacter]->uVoiceID = v38;
                 ReloadPlayerPortraits(uActiveCharacter - 1, (char)v37);
                 }
             pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
-            v1->PlaySound(SPEECH_82, 0);
+            pPlayers[uActiveCharacter]->PlaySound(SPEECH_82, 0);
             pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
             pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
             return;
@@ -3119,31 +3119,31 @@
         v39 = v61;
         if ( (unsigned int)v61 | v35 )
             {
-            LODWORD(v1->pConditions[17]) = v35;
+            LODWORD(pPlayers[uActiveCharacter]->pConditions[17]) = v35;
             }
         else
             {
             if ( !v60 && !v58 && !v59 )
             {
               pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
-              v1->PlaySound(SPEECH_82, 0);
+              pPlayers[uActiveCharacter]->PlaySound(SPEECH_82, 0);
               pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
               pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
               return;
             }
-            v1->uPrevFace = v1->uCurrentFace;
-            v1->uPrevVoiceID = v1->uVoiceID;
-            v1->SetCondition(0x11u, 1);
-            v1->uVoiceID = (v1->GetSexByVoice() != 0) + 23;
-            v40 = (v1->GetSexByVoice() != 0) + 23;
-            v1->uCurrentFace = v40;
+            pPlayers[uActiveCharacter]->uPrevFace = pPlayers[uActiveCharacter]->uCurrentFace;
+            pPlayers[uActiveCharacter]->uPrevVoiceID = pPlayers[uActiveCharacter]->uVoiceID;
+            pPlayers[uActiveCharacter]->SetCondition(0x11u, 1);
+            pPlayers[uActiveCharacter]->uVoiceID = (pPlayers[uActiveCharacter]->GetSexByVoice() != 0) + 23;
+            v40 = (pPlayers[uActiveCharacter]->GetSexByVoice() != 0) + 23;
+            pPlayers[uActiveCharacter]->uCurrentFace = v40;
             ReloadPlayerPortraits(uActiveCharacter - 1, (char)v40);
-            LODWORD(v1->pConditions[17]) = LODWORD(pParty->uTimePlayed);
+            LODWORD(pPlayers[uActiveCharacter]->pConditions[17]) = LODWORD(pParty->uTimePlayed);
             v39 = (GUIWindow *)HIDWORD(pParty->uTimePlayed);
             }
-        HIDWORD(v1->pConditions[17]) = (int)v39;
+        HIDWORD(pPlayers[uActiveCharacter]->pConditions[17]) = (int)v39;
         pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
-        v1->PlaySound(SPEECH_82, 0);
+        pPlayers[uActiveCharacter]->PlaySound(SPEECH_82, 0);
         pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
         pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
         return; // void func
@@ -3153,7 +3153,7 @@
     strcpy(a1, "");
     v41->uHeight = 0;
     v41->uY = 0;
-    if ( v1->IsPlayerHealableByTemple() )
+    if ( pPlayers[uActiveCharacter]->IsPlayerHealableByTemple() )
         {
         sprintf(a1, "%s %d %s", pGlobalTXT_LocalizationStrings[104], HIDWORD(v60), pGlobalTXT_LocalizationStrings[97]);
         v63 = 0;