diff mm7_2.cpp @ 358:4a236657a0be

GameMenuButton fix
author Ritor1
date Thu, 21 Feb 2013 17:23:53 +0600
parents ec6cc5cefa4b
children 2bc1c8d68f41
line wrap: on
line diff
--- a/mm7_2.cpp	Thu Feb 21 10:07:51 2013 +0600
+++ b/mm7_2.cpp	Thu Feb 21 17:23:53 2013 +0600
@@ -3704,12 +3704,12 @@
 void __fastcall sub_4BCACC_bounties(signed int a1)
 {
   unsigned int v1; // edi@1
-  signed int v2; // ebx@1
-  signed int v3; // ecx@2
+  //signed int v2; // ebx@1
+  //signed int v3; // ecx@2
   int v4; // eax@5
   signed int v5; // esi@5
-  Player *v6; // ecx@5
-  signed int v7; // edx@5
+  //Player *v6; // ecx@5
+  //signed int v7; // edx@5
   GUIWindow *v8; // esi@10
   unsigned int v9; // eax@12
   int v10; // esi@31
@@ -3757,65 +3757,51 @@
   void *v52; // eax@260
   signed int v53; // edi@260
   int v54; // eax@262
-  signed int v55; // [sp+10h] [bp-10h]@1
+  //signed int v55; // [sp+10h] [bp-10h]@1
   int v56; // [sp+14h] [bp-Ch]@31
 
   v1 = 0;
-  v2 = a1;
-  v55 = a1;
+  //v2 = a1;
+  //v55 = a1;
   if ( !pDialogueWindow->pNumPresenceButton )
     return;
   pRenderer->ClearZBuffer(0, 479);
-  v3 = dword_F8B198;
+  //v3 = dword_F8B198;
   if ( dword_F8B19C != 1 )
     goto LABEL_13;
   if ( dword_F8B198 == 30 )
   {
-    if ( v2 == 17 )
+    if ( a1 == 17 )
     {
       v4 = 0;
       v5 = 0;
-      v6 = pPlayers[uActiveCharacter];
-      v7 = v6->uLevel;
-      if ( v7 > 0 )
+      //v6 = pPlayers[uActiveCharacter];
+      //v7 = pPlayers[uActiveCharacter]->uLevel;
+      if ( pPlayers[uActiveCharacter]->uLevel > 0 )
       {
         do
           v4 += v5++ + 1;
-        while ( v5 < v7 );
-      }
-      if ( v7 < (unsigned __int16)word_4F0866[(unsigned int)window_SpeakInHouse->ptr_1C]
-        && (signed __int64)v6->uExperience < 1000 * v4 )
+        while ( v5 < pPlayers[uActiveCharacter]->uLevel );
+      }
+      if ( pPlayers[uActiveCharacter]->uLevel < (unsigned __int16)word_4F0866[(unsigned int)window_SpeakInHouse->ptr_1C]
+        && (signed __int64)pPlayers[uActiveCharacter]->uExperience < 1000 * v4 )
         return;
     }
     goto LABEL_9;
   }
   v8 = window_SpeakInHouse;
   if ( (dword_F8B198 == 27 || dword_F8B198 == 28)
-    && (v1 = 0,
-        *(&byte_4F09B1[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)window_SpeakInHouse->ptr_1C] + v2)]
-        + pParty->uDaysPlayed % 7))
-    || dword_F8B198 != 23
-    || v55 != 10 )
+    && (v1 = 0, *(&byte_4F09B1[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)window_SpeakInHouse->ptr_1C] + a1)] + pParty->uDaysPlayed % 7))
+    || dword_F8B198 != 23 || a1 != 10 )
   {
 LABEL_9:
     pDialogueWindow->Release();
     pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, v1, v1);
-    pBtn_ExitCancel = pDialogueWindow->CreateButton(
-                   526,
-                   445,
-                   75,
-                   33,
-                   1,
-                   v1,
-                   0x71u,
-                   v1,
-                   v1,
-                   pGlobalTXT_LocalizationStrings[74],// "End Conversation"
-                   (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0),
-                   v1);
+    pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, v1, 0x71u, v1, v1, pGlobalTXT_LocalizationStrings[74],// "End Conversation"
+                   (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0), v1);
     pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, v1, 0x51u, v1, v1, "", (Texture *)v1);
 LABEL_10:
-    v3 = dword_F8B198;
+    //v3 = dword_F8B198;
     v8 = window_SpeakInHouse;
     goto LABEL_11;
   }
@@ -3826,35 +3812,35 @@
     goto LABEL_10;
   }
 LABEL_11:
-  dword_F8B19C = v55;
-  if ( v3 < 19 )
-  {
-    v9 = pIcons_LOD->LoadTexture(off_4F03B8[v3], TEXTURE_16BIT_PALETTE);
-    v3 = dword_F8B198;
+  dword_F8B19C = a1;
+  if ( dword_F8B198 < 19 )
+  {
+    v9 = pIcons_LOD->LoadTexture(off_4F03B8[dword_F8B198], TEXTURE_16BIT_PALETTE);
+    //v3 = dword_F8B198;
     dword_F8B164 = &pIcons_LOD->pTextures[v9];
 LABEL_13:
     v8 = window_SpeakInHouse;
   }
-  if ( v3 > 21 )
-  {
-    if ( v3 == 22 )
+  if ( dword_F8B198 > 21 )
+  {
+    if ( dword_F8B198 == 22 )
     {
       if ( dword_F8B19C >= 7 && dword_F8B19C <= 8 )
         pKeyActionMap->EnterText(1, 10, v8);
       return;
     }
-    if ( v3 != 23 && v3 != 30 )
+    if ( dword_F8B198 != 23 && dword_F8B198 != 30 )
       return;
   }
   else
   {
-    if ( v3 != 21 )
-    {
-      if ( v3 <= (signed int)v1 )
+    if ( dword_F8B198 != 21 )
+    {
+      if ( dword_F8B198 <= (signed int)v1 )
         return;
-      if ( v3 > 4 )
-      {
-        if ( v3 <= 16 )
+      if ( dword_F8B198 > 4 )
+      {
+        if ( dword_F8B198 <= 16 )
         {
           if ( (signed __int64)__PAIR__(
                                  *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472],
@@ -3890,9 +3876,9 @@
           }
           return;
         }
-        if ( v3 != 17 )
+        if ( dword_F8B198 != 17 )
           return;
-        if ( v55 == 99 )
+        if ( a1 == 99 )
         {
           v10 = (int)((char *)v8->ptr_1C - 102);
           v56 = v10;
@@ -3906,9 +3892,7 @@
             v12 = v10;
             v13 = 0;
             pParty->field_75A[v12] = 0;
-            *(_QWORD *)v11 = (signed __int64)((double)(309657600
-                                                     * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015))
-                                            * 0.033333335);
+            *(_QWORD *)v11 = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
             v14 = rand() % 258;
             v15 = window_SpeakInHouse;
             pParty->field_750[v12] = v14 + 1;
@@ -4092,7 +4076,7 @@
           }
           goto LABEL_196;
         }
-        if ( v55 == 100 )
+        if ( a1 == 100 )
         {
           pKeyActionMap->EnterText(1, 10, v8);
           goto LABEL_196;
@@ -4100,10 +4084,10 @@
       }
     }
   }
-  if ( v55 > 95 )
+  if ( a1 > 95 )
   {
 LABEL_196:
-    switch ( v55 )
+    switch ( a1 )
     {
       case 96:
         pDialogueWindow->eWindowType = WINDOW_MainMenu;
@@ -4134,25 +4118,25 @@
     }
     return;
   }
-  if ( v55 != 95 && v55 != 2 )
-  {
-    if ( v55 == 3 )
+  if ( a1 != 95 && a1 != 2 )
+  {
+    if ( a1 == 3 )
     {
       dword_F8B19C = 3;
     }
     else
     {
-      if ( v55 == 4 )
+      if ( a1 == 4 )
       {
         dword_F8B19C = 4;
       }
       else
       {
-        if ( v55 != 5 )
-        {
-          if ( v55 > 35 )
-          {
-            if ( v55 <= 72 )
+        if ( a1 != 5 )
+        {
+          if ( a1 > 35 )
+          {
+            if ( a1 <= 72 )
             {
               v35 = pPlayers[uActiveCharacter];
               //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
@@ -4171,7 +4155,7 @@
               if (false)
               //if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
               {
-                v38 = (int)(&v35->uIntelligence + v55);
+                v38 = (int)(&v35->uIntelligence + a1);
                 if ( !*(short *)v38 )
                 {
                   if ( pParty->uNumGold < v37 )
@@ -4195,7 +4179,7 @@
             }
             else
             {
-              if ( v55 == 94 )
+              if ( a1 == 94 )
               {
                 pDialogueWindow->eWindowType = WINDOW_MainMenu;
                 sub_4BCA33();
@@ -4219,7 +4203,7 @@
     sub_4B8F94();
     v8 = window_SpeakInHouse;
     v40 = window_SpeakInHouse->ptr_1C;
-    v3 = dword_F8B198;
+    //v3 = dword_F8B198;
     v41 = pParty->uTimePlayed
         //+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
         + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
@@ -4231,7 +4215,7 @@
   v43 = 0;
   //v44 = p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C];
   v44 = p2DEvents[(unsigned int)v8->ptr_1C - 1].uType;
-  if ( v55 == 2 )
+  if ( a1 == 2 )
   {
     if ( _4F063C_smthn_by_2da_uType[v44] )
     {
@@ -4241,7 +4225,7 @@
         if ( v45 )
         {
           v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
-          v3 = dword_F8B198;
+          //v3 = dword_F8B198;
           v8 = window_SpeakInHouse;
           dword_F8B168[v43] = &pIcons_LOD->pTextures[v46];
         }
@@ -4251,7 +4235,7 @@
       //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
       while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
     }
-    if ( v3 == 1 )
+    if ( dword_F8B198 == 1 )
     {
       v47 = v8->ptr_1C;
       v48 = 0;
@@ -4284,7 +4268,7 @@
         if ( v50 )
         {
           v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
-          v3 = dword_F8B198;
+          //v3 = dword_F8B198;
           v8 = window_SpeakInHouse;
           dword_F8B168[v43] = &pIcons_LOD->pTextures[v51];
         }
@@ -4294,7 +4278,7 @@
       //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
       while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
     }
-    if ( v3 == 1 )
+    if ( dword_F8B198 == 1 )
     {
       v52 = v8->ptr_1C;
       v53 = 0;