changeset 662:8c595c7a3218

m
author Ritor1
date Tue, 12 Mar 2013 11:34:08 +0600
parents 2535151505da
children a32962bca266
files Indoor.cpp UIHouses.cpp
diffstat 2 files changed, 13 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/Indoor.cpp	Tue Mar 12 09:43:50 2013 +0600
+++ b/Indoor.cpp	Tue Mar 12 11:34:08 2013 +0600
@@ -3338,7 +3338,7 @@
         v51 = v40->zCalc2;
         v56 = (unsigned __int64)(v51 * (signed __int64)(sY << 16)) >> 16;
         v42 = (v56 + v40->zCalc3 + v57 + 32768) >> 16;
-        goto LABEL_46;
+        v39 = sZ - v42;
       }
 LABEL_47:
       if ( v39 >= 0 )
@@ -3354,7 +3354,6 @@
         return v38;
     }
     v42 = this->pVertices[*v40->pVertexIDs].z;
-LABEL_46:
     v39 = sZ - v42;
     goto LABEL_47;
   }
--- a/UIHouses.cpp	Tue Mar 12 09:43:50 2013 +0600
+++ b/UIHouses.cpp	Tue Mar 12 11:34:08 2013 +0600
@@ -1015,17 +1015,17 @@
   *(float *)&v83 = v2;
   *(float *)&v89 = v2 * v2;
   v3 = (signed __int64)(*(float *)&v89 * 0.1);
-  v4 = v3 * (100 - pPlayer->GetMerchant()) / 100;
-  if ( v4 < v3 / 3 )
-    v4 = v3 / 3;
+  pItemNum = v3 * (100 - pPlayer->GetMerchant()) / 100;
+  if ( pItemNum < v3 / 3 )
+    pItemNum = v3 / 3;
   v5 = 1;
-  pOutString = (GUIFont *)v4;
-  if ( v4 <= 0 )
+  pOutString = (GUIFont *)pItemNum;
+  if ( pItemNum <= 0 )
     pOutString = (GUIFont *)1;
   v6 = (signed __int64)(*(float *)&v89 * *(float *)&v83 * 0.0099999998);
   v7 = v6 * (100 - pPlayer->GetMerchant()) / 100;
   if ( v7 < v6 / 3 )
-    v7 = v6 / 3;
+  v7 = v6 / 3;
   v83 = v7;
   if ( v7 <= 0 )
   {
@@ -1059,19 +1059,16 @@
       strcat(v77, "\n \n");
       v75[0] = 0;
       pTextHeight = 0;
-      v31 = (signed int)window_SpeakInHouse->ptr_1C;
-      if ( v31 >= 108 && v31 <= 120 )
+      if ( (signed int)window_SpeakInHouse->ptr_1C >= 108 && (signed int)window_SpeakInHouse->ptr_1C <= 120 )
       {
         sprintf(v75, "\xC" "%05d", pDialogueWindow->pCurrentPosActiveItem == 5 ? pColorYellow : pColorWhite);
         strcat(v75, pGlobalTXT_LocalizationStrings[611]); // Play Arcomage
         pTextHeight = pFontArrus->CalcTextHeight(v75, &dialog_window, 0, 0);
       }
-      v34 = pDialogueWindow->pStartingPosActiveItem;
-      v35 = v34 + pDialogueWindow->pNumPresenceButton;
+      pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
       v36 = LOBYTE(pFontArrus->uFontHeight) - 3;
       v37 = -pDialogueWindow->pNumPresenceButton < 0;
-      pOutString = (GUIFont *)pDialogueWindow->pStartingPosActiveItem;
-      if ( !(v37 ^ v34 < v35) )
+      if ( !(v37 ^ pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton) )
       {
         sprintf(pTmpBuf, "%s%s%s%s", Dest, a1, v77, v75);
         dialog_window.DrawTitleText(pFontArrus, 0, 146, 0, pTmpBuf, 3);
@@ -1079,7 +1076,7 @@
       }
       while ( 1 )
       {
-        pButton = pDialogueWindow->GetControl((unsigned int)pOutString);
+        pButton = pDialogueWindow->GetControl(pNumActiveItem);
         if ( pButton->uControlParam == 15 )
         {
           v46 = pTextHeight;
@@ -1115,8 +1112,8 @@
           v41 = v39 + v40 - 1;
           pButton->uW = v41;
         }
-        pOutString = (GUIFont *)((char *)pOutString + 1);
-        if ( (signed int)pOutString >= pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem )
+        pNumActiveItem++;
+        if ( pNumActiveItem >= pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem )
         {
           sprintf(pTmpBuf, "%s%s%s%s", &Dest, &a1, &v77, &v75);
           dialog_window.DrawTitleText(pFontArrus, 0, 146, 0, pTmpBuf, 3);