diff mm7_5.cpp @ 199:66db86fa4ed2

Hireling dialogues
author Nomad
date Sat, 16 Feb 2013 22:20:51 +0200
parents e6e348d66a75
children 30aa44013f7a
line wrap: on
line diff
--- a/mm7_5.cpp	Sat Feb 16 21:46:07 2013 +0200
+++ b/mm7_5.cpp	Sat Feb 16 22:20:51 2013 +0200
@@ -69,9 +69,9 @@
   unsigned int v2; // edx@7
   Actor *pActor; // ecx@13
   int v4; // ecx@18
-  NPCData *pNPCData0; // eax@18
-  int v6; // edx@20
-  int v7; // ecx@29
+  //NPCData *pNPCData0; // eax@18
+  //int v6; // edx@20
+  //int v7; // ecx@29
   unsigned int v8; // edx@59
   unsigned int v9; // ecx@60
   unsigned int v10; // ecx@73
@@ -244,7 +244,7 @@
   const char *v177; // [sp+0h] [bp-5FCh]@629
   char *v178; // [sp+0h] [bp-5FCh]@637
   int v179; // [sp+4h] [bp-5F8h]@0
-  signed int _this; // [sp+14h] [bp-5E8h]@22
+  //signed int _this; // [sp+14h] [bp-5E8h]@22
   signed int thisa; // [sp+14h] [bp-5E8h]@251
   signed int thisb; // [sp+14h] [bp-5E8h]@272
   Player *pPlayer7; // [sp+14h] [bp-5E8h]@373
@@ -333,44 +333,49 @@
           //goto _actor_init_dlg;
           pActor->InitializeDialogue(v0);
           continue;
-        case UIMSG_86:
-        case UIMSG_87:
-          if ( bNoNPCHiring != 1 && !pCurrentScreen )
-          {
+        case UIMSG_StartHireling1Dialogue:
+        case UIMSG_StartHireling2Dialogue:
+        {
+          if (bNoNPCHiring || pCurrentScreen)
+            continue;
+
             if ( pMessageQueue_50CBD0->uNumMessages )
               pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
             uAction = 0;
             uNumSeconds = uMessage - 134;
             v4 = 0;
-            pNPCData0 = pParty->pHirelings;
-            do
-            {
-              if ( pNPCData0->pName )
-              {
-                v6 = uAction++;
-                pTmpBuf[v6] = v4;
-              }
-              ++pNPCData0;
-              ++v4;
-            }
-            while ( (signed int)pNPCData0 < (signed int)&pParty->pPickedItem );
-            _this = 0;
-            if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
-            {
-              pNPCData4 = pNPCStats->pNewNPCData;
-              do
-              {
-                if ( pNPCData4->uFlags & 0x80
-                  && (!pParty->pHirelings[0].pName || strcmp(pNPCData4->pName, pParty->pHirelings[0].pName))
-                  && (!pParty->pHirelings[1].pName || strcmp(pNPCData4->pName, pParty->pHirelings[1].pName)) )
+
+            for (uint i = 0; i < 2; ++i)
+            //pNPCData0 = pParty->pHirelings;
+            //do
+            {
+              if (pParty->pHirelings[i].pName)
+              //{
+                //v6 = uAction++;
+                pTmpBuf[uAction++] = i;
+              //}
+              //++pNPCData0;
+              //++v4;
+            }
+            //while ( (signed int)pNPCData0 < (signed int)&pParty->pPickedItem );
+
+            //_this = 0;
+            for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i)
+            {
+              auto npc = pNPCStats->pNewNPCData + i;
+              //do
+              //{
+                if (npc->uFlags & 0x80 &&
+                    (!pParty->pHirelings[0].pName || strcmp(npc->pName, pParty->pHirelings[0].pName)) &&
+                    (!pParty->pHirelings[1].pName || strcmp(npc->pName, pParty->pHirelings[1].pName)) )
                 {
-                  v7 = uAction++;
-                  pTmpBuf[v7] = _this + 2;
+                  //v7 =;
+                  pTmpBuf[uAction++] = i + 2;
                 }
-                ++_this;
-                ++pNPCData4;
-              }
-              while ( _this < (signed int)pNPCStats->uNumNewNPCs );
+                //++_this;
+                //++pNPCData4;
+              //}
+              //while ( _this < (signed int)pNPCStats->uNumNewNPCs );
             }
             if ( (signed int)(uNumSeconds + (unsigned __int8)pParty->field_709) < uAction )
             {