diff mm7_5.cpp @ 146:30e731fc0f7a

Слияние
author Ritor1
date Mon, 11 Feb 2013 09:08:00 +0600
parents bd185c7cbd09 bf7ea4c330b3
children c70fea5013aa
line wrap: on
line diff
--- a/mm7_5.cpp	Mon Feb 11 09:07:47 2013 +0600
+++ b/mm7_5.cpp	Mon Feb 11 09:08:00 2013 +0600
@@ -68,7 +68,7 @@
   unsigned int v2; // edx@7
   Actor *pActor; // ecx@13
   int v4; // ecx@18
-  NPCData *pNPCData; // eax@18
+  NPCData *pNPCData0; // eax@18
   int v6; // edx@20
   int v7; // ecx@29
   unsigned int v8; // edx@59
@@ -341,18 +341,18 @@
             uAction = 0;
             uNumSeconds = uMessage - 134;
             v4 = 0;
-            pNPCData = pParty->pHirelings;
+            pNPCData0 = pParty->pHirelings;
             do
             {
-              if ( pNPCData->pName )
+              if ( pNPCData0->pName )
               {
                 v6 = uAction++;
                 pTmpBuf[v6] = v4;
               }
-              ++pNPCData;
+              ++pNPCData0;
               ++v4;
             }
-            while ( (signed int)pNPCData < (signed int)&pParty->pPickedItem );
+            while ( (signed int)pNPCData0 < (signed int)&pParty->pPickedItem );
             _this = 0;
             if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
             {
@@ -1777,21 +1777,21 @@
           }
           sub_41426F();
           continue;
-        case UIMSG_BC:
+        case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel
           if ( uMessageParam )
           {
-            GUIWindow::Create(0x272u, 0xB3u, 0, 0, (enum WindowType)90, (int)pBtn_NPCRight, 0);
+            GUIWindow::Create(626, 179, 0, 0, (enum WindowType)90, (int)pBtn_NPCRight, 0);
             v37 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + (unsigned __int8)pParty->field_70A - 2;
             if ( (unsigned __int8)pParty->field_709 < v37 )
             {
-              ++pParty->field_709;
+              ++pParty->field_709;//??? maybe number of the first cell???
               if ( (unsigned __int8)pParty->field_709 >= v37 )
                 pParty->field_709 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + pParty->field_70A - 2;
             }
           }
           else
           {
-            GUIWindow::Create(0x1D5u, 0xB3u, 0, 0, (enum WindowType)90, (int)pBtn_NPCLeft, 0);
+            GUIWindow::Create(469, 179, 0, 0, (enum WindowType)90, (int)pBtn_NPCLeft, 0);
             if ( pParty->field_709 )
             {
               --pParty->field_709;
@@ -15999,7 +15999,7 @@
 
 
 //----- (00416B01) --------------------------------------------------------
-void __thiscall sub_416B01(void *_this)
+void __thiscall sub_416B01(void *_this)//PopupWindowForBenefitAndJoinText
 {
   int v1; // edi@2
   int v2; // ecx@2
@@ -16026,18 +16026,23 @@
     v1 = 0;
     v2 = 0;
     v3 = pParty->pHirelings;
-    do
+    /*do
     {
       if ( v3->pName )
         pTmpBuf[v1++] = v2;
       ++v3;
       ++v2;
     }
-    while ( (signed int)v3 < (signed int)&pParty->pPickedItem );
+    while ( (signed int)v3 < (signed int)&pParty->pPickedItem );*/
+    for (int i = 0; i < 2; ++i)
+    {
+     if (pParty->pHirelings[i].pName)
+        pTmpBuf[v1++] = i;
+    }
     lpsz = 0;
     if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
     {
-      v4 = pNPCStats->pNewNPCData;
+      /*v4 = pNPCStats->pNewNPCData;
       do
       {
         if ( v4->uFlags & 0x80
@@ -16047,7 +16052,18 @@
         ++lpsz;
         ++v4;
       }
-      while ( (signed int)lpsz < (signed int)pNPCStats->uNumNewNPCs );
+      while ( (signed int)lpsz < (signed int)pNPCStats->uNumNewNPCs );*/
+      for (int i = 0; i < pNPCStats->uNumNewNPCs; ++i)
+      {
+        if (pNPCStats->pNewNPCData[i].uFlags & 0x80)
+        {
+          if (!pParty->pHirelings[0].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[0].pName))
+          {
+            if (!pParty->pHirelings[1].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[1].pName))
+              pTmpBuf[v1++] = i + 2;
+          }
+        }
+      }
     }
     if ( (signed int)((char *)v17 + (unsigned __int8)pParty->field_709) < v1 )
     {
@@ -16059,11 +16075,11 @@
         if ( a2 == 57 )
           v7 = pNPCTopics[512].pText;
         else
-          v7 = (const CHAR *)*(&pNPCStats->field_13A5C + 5 * v5->uProfession);
+          v7 = (const CHAR *)pNPCStats->pProfessions[v5->uProfession].pBenefits;
         lpsz = v7;
         if ( !v7 )
         {
-          lpsz = (LPCSTR)*(&pNPCStats->field_13A64 + 5 * v6->uProfession);
+          lpsz = (LPCSTR)pNPCStats->pProfessions[v5->uProfession].pJoinText;
           if ( !lpsz )
             lpsz = "";
         }