diff mm7_4.cpp @ 336:ea55d6414029

Event_proceccor preliminary
author Gloval
date Thu, 21 Feb 2013 00:33:12 +0400
parents 8e23edf57e27
children a8ee15a20bea
line wrap: on
line diff
--- a/mm7_4.cpp	Wed Feb 20 21:35:13 2013 +0400
+++ b/mm7_4.cpp	Thu Feb 21 00:33:12 2013 +0400
@@ -9113,7 +9113,7 @@
     v18 = v5;
     if ( !v5 )
       return;
-    v6 = 9 * (v5 + 12 * (unsigned int)ptr_507BC0->ptr_1C);
+    v6 = 9 * (v5 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C);
     v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4);
     if ( dword_F8B19C != 2 )
       v7 = (ItemGen *)&pParty->field_C59C[v6 + 715];
@@ -9126,7 +9126,7 @@
     v3 = pRenderer->pActiveZBuffer[v2] & 0xFFFF;
     v18 = pRenderer->pActiveZBuffer[v2] & 0xFFFF;
     if ( v18 )
-      sub_4B1523((int *)&pParty->pPlayers[1].uExpressionTimeLength + 9 * (v3 + 12 * (unsigned int)ptr_507BC0->ptr_1C));
+      sub_4B1523((int *)&pParty->pPlayers[1].uExpressionTimeLength + 9 * (v3 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C));
   }
 }
 // F8B198: using guessed type int dword_F8B198;
@@ -9198,12 +9198,12 @@
         if ( dword_F8B198 != 23 )
           return;
       }
-      v1 = (unsigned int)ptr_507BC0->ptr_1C;
+      v1 = (unsigned int)window_SpeakInHouse->ptr_1C;
 LABEL_28:
       HousePlaySomeSound(v1, v0);
       return;
     }
-    v1 = (unsigned int)ptr_507BC0->ptr_1C;
+    v1 = (unsigned int)window_SpeakInHouse->ptr_1C;
     if ( (signed __int64)__PAIR__(pParty->field_3C._shop_ban_times[2 * v1 + 1], pParty->field_3C._shop_ban_times[2 * v1]) <= (signed __int64)pParty->uTimePlayed )
     {
       if ( pParty->uNumGold <= 0x2710 )
@@ -9649,7 +9649,7 @@
   strcpy(v22, v24);
   pParty->field_709 = 0;
   sub_44A56A();
-  PrepareHouse((unsigned int)ptr_507BC0->ptr_1C);
+  PrepareHouse((unsigned int)window_SpeakInHouse->ptr_1C);
   dword_F8B19C = 1;
   if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
   {
@@ -10444,7 +10444,7 @@
       v19 = 1;
       do
       {
-        v20 = (char *)ptr_507BC0->ptr_1C + 4 * (unsigned int)ptr_507BC0->ptr_1C + v19;
+        v20 = (char *)window_SpeakInHouse->ptr_1C + 4 * (unsigned int)window_SpeakInHouse->ptr_1C + v19;
         if ( v1 )
           v21 = word_4F063E[(signed int)v20];
         else
@@ -10524,7 +10524,7 @@
         v12 = 1;
         do
         {
-          v13 = v11 + 2 * (unsigned int)ptr_507BC0->ptr_1C - 30;
+          v13 = v11 + 2 * (unsigned int)window_SpeakInHouse->ptr_1C - 30;
           v14 = v12 + 4 * v13 + v13;
           if ( v10 )
             v15 = word_4F06D8[v14];
@@ -10924,7 +10924,7 @@
           sub_4B36CC(1, 0x10u);
           v4 = 3;
           sub_4B36CC(2, 0x60u);
-          v5 = (signed int)ptr_507BC0->ptr_1C;
+          v5 = (signed int)window_SpeakInHouse->ptr_1C;
           if ( v5 < 108 || v5 > 120 )
             goto LABEL_28;
           v4 = 4;
@@ -11544,7 +11544,7 @@
   int v73; // [sp+80h] [bp-4h]@14
 
   v0 = pPlayers[uActiveCharacter];
-  memcpy(&v65, ptr_507BC0, sizeof(v65));
+  memcpy(&v65, window_SpeakInHouse, sizeof(v65));
   v65.uFrameX = 483;
   v65.uFrameWidth = 148;
   v65.uFrameZ = 334;
@@ -11558,7 +11558,7 @@
     v3 += v4 + 1;
   v5 = 1000 * v3;
   v6 = HIDWORD(v0->uExperience);
-  v7 = ptr_507BC0->ptr_1C;
+  v7 = window_SpeakInHouse->ptr_1C;
   v68 = (unsigned __int16)word_4F0866[(signed int)v7];
   v66 = 1000 * v3;
   if ( (signed __int64)__PAIR__(v6, LODWORD(v0->uExperience)) >= v66 )
@@ -11592,7 +11592,7 @@
             i = 0;
             v13 = pDialogueWindow;
             //v14 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
-            v14 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0);
+            v14 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
             v73 = v14 * (100 - v0->GetMerchant()) / 100;
             if ( v73 < v14 / 3 )
               v73 = v14 / 3;
@@ -11695,7 +11695,7 @@
           if ( pParty->uNumGold >= i )
           {
             Party::TakeGold(i);
-            HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
+            HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2);
             ++v0->uLevel;
             v0->uSkillPoints += v0->uLevel / 10 + 5;
             v0->sHealth = v0->GetMaxHealth();
@@ -11714,7 +11714,7 @@
             if ( *v39 > v37 )
             {
               v40 = sub_494820(pParty->uCurrentHour);
-              v41 = ptr_507BC0->ptr_1C;
+              v41 = window_SpeakInHouse->ptr_1C;
               v42 = 60 * (v40 + 4) - pParty->uCurrentMinute;
               if ( v41 == (void *)94 || v41 == (void *)95 )
                 v42 += 720;
@@ -11731,7 +11731,7 @@
           ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold"
           v63 = 4;
 LABEL_55:
-          HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v63);
+          HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, v63);
 LABEL_56:
           result = pMessageQueue_50CBD0->uNumMessages;
           if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
@@ -11990,7 +11990,7 @@
 
   v0 = pPlayers[uActiveCharacter];
   _this = pPlayers[uActiveCharacter];
-  memcpy(&v112, ptr_507BC0, sizeof(v112));
+  memcpy(&v112, window_SpeakInHouse, sizeof(v112));
   v112.uFrameX = 483;
   v112.uFrameWidth = 148;
   v112.uFrameZ = 334;
@@ -12060,7 +12060,7 @@
         {
           v31 = pDialogueWindow;
           v3 = 0;
-          v32 = ptr_507BC0->ptr_1C;
+          v32 = window_SpeakInHouse->ptr_1C;
           v118 = 0;
             //v33 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v32] * 500.0);
             v33 = (signed __int64)(p2DEvents[(signed int)v32 - 1].flt_24 * 500.0);
@@ -12171,9 +12171,9 @@
         return result;
       v96 = 0;
       v94 = 5;
-      v93 = ptr_507BC0->ptr_1C;
+      v93 = window_SpeakInHouse->ptr_1C;
       v90 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5];
-      v28 = (int)ptr_507BC0->ptr_1C;
+      v28 = (int)window_SpeakInHouse->ptr_1C;
       uPlayerID = uActiveCharacter - 1;
       v29 = _this->_490EEE((ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5], 3, v28, 5);
       v9 = uPlayerID;
@@ -12265,16 +12265,16 @@
                   v4 = (char *)&_this->pInventoryItems[result-1];
                   if ( v4[20] & 1 )
                   {
-                    v5 = BuilDialogueString("%24", uActiveCharacter - 1, (ItemGen *)v4, (char *)ptr_507BC0->ptr_1C, 4, 0);
+                    v5 = BuilDialogueString("%24", uActiveCharacter - 1, (ItemGen *)v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
                     v97 = 3;
                     v95 = v5;
                     v92 = white;
                     v6 = (212 - pFontArrus->CalcTextHeight(v5, &v112, 0, 0)) / 2 + 101;
                     return (int)v112.DrawTitleText(pFontArrus, v3, v6, v92, v95, v97);
                   }
-                  v93 = ptr_507BC0->ptr_1C;
+                  v93 = window_SpeakInHouse->ptr_1C;
                   v90 = (ItemGen *)v4;
-                  v7 = (int)ptr_507BC0->ptr_1C;
+                  v7 = (int)window_SpeakInHouse->ptr_1C;
                   uPlayerID = uActiveCharacter - 1;
                   v8 = ((Player *)_this)->_490EEE((ItemGen *)v4, 3, v7, 4);
                   v9 = uPlayerID;
@@ -12301,9 +12301,9 @@
         return result;
       v96 = 0;
       v94 = 3;
-      v93 = ptr_507BC0->ptr_1C;
+      v93 = window_SpeakInHouse->ptr_1C;
       v90 = (ItemGen *)&_this->pInventoryItems[result-1];
-      v12 = (int)ptr_507BC0->ptr_1C;
+      v12 = (int)window_SpeakInHouse->ptr_1C;
       uPlayerID = uActiveCharacter - 1;
       v13 = _this->_490EEE(v90, 3, v12, 3);
       v9 = uPlayerID;
@@ -12329,7 +12329,7 @@
   {
     do
     {
-      if ( pParty->field_777C[9 * (v49 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] )
+      if ( pParty->field_777C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
       {
         v50 = dword_F8B168[v49];
         v51 = 152 - v50->uTextureHeight;
@@ -12361,7 +12361,7 @@
     v122 = 0;
     do
     {
-      if ( pParty->field_777C[9 * (v122 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 54] )
+      if ( pParty->field_777C[9 * (v122 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] )
       {
         v54 = dword_F8B168[v122 + 6];
         v55 = 306 - v54->uTextureHeight;
@@ -12391,7 +12391,7 @@
   {
     do
     {
-      if ( pParty->field_C59C[9 * (v49 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
+      if ( pParty->field_C59C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
       {
         v58 = dword_F8B168[v49];
         v59 = 152 - v58->uTextureHeight;
@@ -12423,7 +12423,7 @@
     v122 = 0;
     do
     {
-      if ( pParty->field_C59C[9 * (v122 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 778] )
+      if ( pParty->field_C59C[9 * (v122 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] )
       {
         v62 = dword_F8B168[v122 + 6];
         v63 = 306 - v62->uTextureHeight;
@@ -12460,7 +12460,7 @@
     {
       do
       {
-        if ( pParty->field_777C[9 * (v66 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] )
+        if ( pParty->field_777C[9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
           ++v117;
         ++v66;
       }
@@ -12470,7 +12470,7 @@
     {
       do
       {
-        if ( pParty->field_C59C[9 * (v66 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
+        if ( pParty->field_C59C[9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
           ++v117;
         ++v66;
       }
@@ -12493,8 +12493,8 @@
     if ( !v117 )
       return (int)v112._4B1854(
                     __PAIR__(
-                      pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C + 1],
-                      pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C])
+                      pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C + 1],
+                      pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C])
                   - pParty->uTimePlayed);
     v70 = pMouse->GetCursorPos(&v102);
     result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y];
@@ -12502,7 +12502,7 @@
     {
       v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1;
       v117 = v71;
-      v72 = (int)ptr_507BC0->ptr_1C;
+      v72 = (int)window_SpeakInHouse->ptr_1C;
       v73 = 9 * (v71 + 12 * v72);
       v74 = (ItemGen *)&pParty->field_777C[v73];
       if ( dword_F8B19C != 2 )
@@ -12512,7 +12512,7 @@
         v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24"
         v96 = 0;
         v94 = 2;
-        v93 = ptr_507BC0->ptr_1C;
+        v93 = window_SpeakInHouse->ptr_1C;
         v90 = v74;
         v9 = uActiveCharacter - 1;
       }
@@ -12520,7 +12520,7 @@
       {
         v96 = 0;
         v94 = 2;
-        v93 = ptr_507BC0->ptr_1C;
+        v93 = window_SpeakInHouse->ptr_1C;
         v90 = v74;
         uPlayerID = uActiveCharacter - 1;
         v75 = _this->_490EEE(v74, 3, v72, 2);
@@ -12927,8 +12927,8 @@
   unsigned int v62; // [sp+2E4h] [bp-8h]@13
   int v63; // [sp+2E8h] [bp-4h]@1
 
-  v0 = ptr_507BC0;
-  memcpy(&v52, ptr_507BC0, sizeof(v52));
+  v0 = window_SpeakInHouse;
+  memcpy(&v52, window_SpeakInHouse, sizeof(v52));
   v58 = pPlayers[uActiveCharacter];
   v1 = v58;
   v52.uFrameX = 483;
@@ -12964,7 +12964,7 @@
           if ( pParty->uNumGold < v63 )
           {
             ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
-            HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
+            HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2);
           }
           else
           {
@@ -12991,7 +12991,7 @@
     v63 = 32;
     do
     {
-      if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v6 + 12 * (unsigned int)ptr_507BC0->ptr_1C)) )
+      if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v6 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)) )
       {
         pRenderer->DrawTextureTransparent(v63, 0x5Au, dword_F8B168[v6]);
         ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), dword_F8B168[v6], v6 + 1);
@@ -13007,7 +13007,7 @@
     v63 = 32;
     do
     {
-      if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v7 + 12 * (unsigned int)ptr_507BC0->ptr_1C)) )
+      if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v7 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)) )
       {
         pRenderer->DrawTextureTransparent(v63, 0xFAu, dword_F8B168[v7]);
         ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), dword_F8B168[v7], v7 + 1);
@@ -13023,7 +13023,7 @@
     {
       v8 = 0;
       v9 = 12;
-      v10 = (char *)(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 108 * (unsigned int)ptr_507BC0->ptr_1C);
+      v10 = (char *)(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 108 * (unsigned int)window_SpeakInHouse->ptr_1C);
       do
       {
         if ( *(int *)v10 )
@@ -13040,17 +13040,17 @@
       if ( !v8 )
         return (int)v52._4B1854(
                       __PAIR__(
-                        *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)ptr_507BC0->ptr_1C + 44472],
-                        *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)ptr_507BC0->ptr_1C + 44468])
+                        *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44472],
+                        *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44468])
                     - pParty->uTimePlayed);
       v12 = pMouse->GetCursorPos(&v51);
       result = v12->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v50)->y];
       v13 = pRenderer->pActiveZBuffer[result] & 0xFFFF;
       if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
       {
-        v14 = ptr_507BC0->ptr_1C;
+        v14 = window_SpeakInHouse->ptr_1C;
         v15 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v13 + 12 * (int)v14));
-        v16 = (int)ptr_507BC0->ptr_1C;
+        v16 = (int)window_SpeakInHouse->ptr_1C;
         uPlayerID = uActiveCharacter - 1;
         v17 = v1->_490EEE(
                 (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)v14,
@@ -13073,7 +13073,7 @@
   }
   if ( !(unsigned __int16)_449B57_test_bit(
                             (unsigned __int8 *)v1->field_152,
-                            word_4F0704[2 * (unsigned int)ptr_507BC0->ptr_1C]) )
+                            word_4F0704[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) )
   {
     v36 = pNPCTopics[121].pText;
     v37 = v57;
@@ -13277,8 +13277,8 @@
   unsigned int v65; // [sp+1BCh] [bp-8h]@6
   DDM_DLV_Header *v66; // [sp+1C0h] [bp-4h]@6
 
-  v0 = ptr_507BC0;
-  memcpy(&v57, ptr_507BC0, sizeof(v57));
+  v0 = window_SpeakInHouse;
+  memcpy(&v57, window_SpeakInHouse, sizeof(v57));
   v57.uFrameX = 483;
   v57.uFrameWidth = 148;
   v57.uFrameZ = 334;
@@ -13302,7 +13302,7 @@
           {
             v4 = pDialogueWindow;
             v61 = pDialogueWindow;
-            v5 = ptr_507BC0->ptr_1C;
+            v5 = window_SpeakInHouse->ptr_1C;
             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);
@@ -13395,7 +13395,7 @@
         return result;
       }
       //v24 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
-      v24 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier;
+      v24 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
       v25 = 0;
       if ( pParty->uNumGold >= (unsigned int)(signed __int64)v24 )
       {
@@ -13469,7 +13469,7 @@
     {
 LABEL_55:
       ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
-      HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
+      HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2);
       goto LABEL_46;
     }
     Party::TakeGold(v2);
@@ -13481,7 +13481,7 @@
     memset(v1, 0, 0xA0u);
     v1->sHealth = v1->GetMaxHealth();
     v1->sMana = v1->GetMaxMana();
-    v36 = (signed int)ptr_507BC0->ptr_1C;
+    v36 = (signed int)window_SpeakInHouse->ptr_1C;
     if ( v36 != 78 && (v36 <= 80 || v36 > 82) )
     {
       if ( (unsigned int)v61 | v35 )
@@ -13615,12 +13615,12 @@
   void *result; // eax@15
   signed int v12; // [sp-4h] [bp-18h]@7
 
-  v0 = ptr_507BC0;
+  v0 = window_SpeakInHouse;
   v1 = 0;
-  v2 = (int)&ptr_507BC0->ptr_1C;
-  v3 = (signed int)ptr_507BC0->ptr_1C;
+  v2 = (int)&window_SpeakInHouse->ptr_1C;
+  v3 = (signed int)window_SpeakInHouse->ptr_1C;
   //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]] )
-  if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType] )
+  if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
   {
     while ( v3 > 14 )
     {
@@ -13650,16 +13650,16 @@
           v6 = v12;
 LABEL_13:
           pItemsTable->GenerateItem(v5, v6, (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]);
-          v0 = ptr_507BC0;
-          v2 = (int)&ptr_507BC0->ptr_1C;
-          pParty->field_C59C[9 * (v1 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 729] = 1;
+          v0 = window_SpeakInHouse;
+          v2 = (int)&window_SpeakInHouse->ptr_1C;
+          pParty->field_C59C[9 * (v1 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 729] = 1;
           goto LABEL_14;
         }
         auto _a = (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724];
         _a->Reset();
         v2 = (int)&v0->ptr_1C;
         v10 = rand();
-        v0 = ptr_507BC0;
+        v0 = window_SpeakInHouse;
         pParty->field_C59C[9 * (v1 + 12 * *(int *)v2) + 724] = v10 % 32 + 740;
       }
 LABEL_14:
@@ -13722,8 +13722,8 @@
   int v34; // [sp+74h] [bp-8h]@17
   int v35; // [sp+78h] [bp-4h]@17
 
-  v0 = ptr_507BC0;
-  memcpy(&v28, ptr_507BC0, sizeof(v28));
+  v0 = window_SpeakInHouse;
+  memcpy(&v28, window_SpeakInHouse, sizeof(v28));
   v1 = pPlayers[uActiveCharacter];
   v28.uFrameX = 483;
   v28.uFrameWidth = 148;
@@ -13774,7 +13774,7 @@
           *(short *)v6 = 1;
           v27 = 2;
         }
-        HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v27);
+        HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, v27);
       }
     }
     else
@@ -13794,7 +13794,7 @@
   }
   if ( !(unsigned __int16)_449B57_test_bit(
                             (unsigned __int8 *)v1->field_152,
-                            word_4F0754[2 * (unsigned int)ptr_507BC0->ptr_1C]) )
+                            word_4F0754[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) )
   {
     v24 = pNPCTopics[171].pText;
     v25 = v31;
@@ -13965,8 +13965,8 @@
   unsigned int s1; // [sp+288h] [bp-8h]@1
   int v66; // [sp+28Ch] [bp-4h]@48
 
-  v0 = ptr_507BC0;
-  memcpy(&v53, ptr_507BC0, sizeof(v53));
+  v0 = window_SpeakInHouse;
+  memcpy(&v53, window_SpeakInHouse, sizeof(v53));
   v2 = 255;
   v61 = pPlayers[uActiveCharacter];
   v1 = v61;
@@ -14009,7 +14009,7 @@
       while ( 1 )
       {
         v47[1] = (const char *)v60;
-        v22 = ptr_507BC0->ptr_1C;
+        v22 = window_SpeakInHouse->ptr_1C;
         v23 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (signed int)v22] + v62);
         v61 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (signed int)v22] + v62);
         v24 = v16->GetControl(v60);
@@ -14027,7 +14027,7 @@
           v47[1] = v27;
           sprintf(a1, format_4E2DC8, v27);
           v66 = (unsigned __int8)byte_4F09B8[v26 * 4];
-          if ( (signed int)ptr_507BC0->ptr_1C >= 63 )
+          if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 )
           {
             if ( CheckHiredNPCSpeciality(8u) )
               v66 -= 2;
@@ -14130,7 +14130,7 @@
       if ( pParty->uNumGold < s1 )
       {
         ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
-        HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 3);
+        HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 3);
         if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
           return;
         pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
@@ -14139,7 +14139,7 @@
       }
       Party::TakeGold(s1);
       v47[1] = (const char *)7;
-      v5 = &byte_4F09B0[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)ptr_507BC0->ptr_1C] + dword_F8B19C)];
+      v5 = &byte_4F09B0[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)window_SpeakInHouse->ptr_1C] + dword_F8B19C)];
       if ( v5[pParty->uDaysPlayed % 7 + 1] )
       {
         if ( _strcmpi(pCurrentMapName, pMapStats->pInfos[(unsigned __int8)*v5].pFilename) )
@@ -14173,9 +14173,9 @@
           pParty->uFallStartY = pParty->vPosition.z;
           pParty->sRotationY = *((int *)v5 + 6);
         }
-        HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
+        HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2);
         v12 = (unsigned __int8)v5[8];
-        if ( (signed int)ptr_507BC0->ptr_1C >= 63 )
+        if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 )
         {
           v63 = SPEECH_72;
           v13 = 2500;
@@ -15082,7 +15082,7 @@
     pParty->field_3C._shop_ban_times[2 * v25] = 0;
     pParty->field_3C._shop_ban_times[2 * v10 + 1] = 0;
 LABEL_21:
-    if ( !dword_597F18 )
+    if ( !start_event_seq_number )
       pAudioPlayer->StopChannels(-1, -1);
     //uCurrentHouse_Animation = p2DEvents_minus1___02[v2];
     uCurrentHouse_Animation = p2DEvents[v2 / sizeof(_2devent) - 1].uAnimationID;