changeset 2099:7edf389d49fc

pCurrentPosActiveItem
author Ritor1
date Fri, 13 Dec 2013 17:46:37 +0600
parents 7810cb3a5fb7
children e460ca22fe8a
files Mouse.cpp mm7_2.cpp
diffstat 2 files changed, 34 insertions(+), 64 deletions(-) [+]
line wrap: on
line diff
--- a/Mouse.cpp	Fri Dec 13 16:10:36 2013 +0600
+++ b/Mouse.cpp	Fri Dec 13 17:46:37 2013 +0600
@@ -799,48 +799,26 @@
       }
       case VK_NEXT:
       {  
-        //if ( pWindowList[v3].field_30 != 0 )   //crashed at skill draw
-        //{
-        //  pMouse->GetClickPos(&uClickX, &uClickY);
-        //  v4 = pWindowList[v3].pStartingPosActiveItem;
-        //  v29 = v4 + pWindowList[v3].pNumPresenceButton; //num buttons more than buttons 
-        //  if ( v4 < v29 )
-        //  {
-        //    while ( 1 )
-        //    {
-        //      pButton = pWindowList[v3].pControlsHead;
-        //      if ( v4 > 0 )
-        //      {
-        //        v15 = v4;
-        //        do
-        //        {
-        //          pButton = pButton->pNext;
-        //          --v15;
-        //        }
-        //        while ( v15 );
-        //      }
-        //      if ( (signed int)uClickX >= (signed int)pButton->uX
-        //        && (signed int)uClickX <= (signed int)pButton->uZ
-        //        && (signed int)uClickY >= (signed int)pButton->uY
-        //        && (signed int)uClickY <= (signed int)pButton->uW )
-        //      {
-        //        pWindowList[v3].pCurrentPosActiveItem = v4;
-        //        return true;
-        //      }
-        //      ++v4;
-        //      if ( v4 >= v29 )
-        //      {
-        //        //v1 = 0;
-        //        //v2 = pMessageQueue_50CBD0->uNumMessages;
-        //        break;
-        //      }
-        //    }
-        //  }
-        //  else
-        //  {
-        //    //v2 = pMessageQueue_50CBD0->uNumMessages;
-        //  }
-        //}
+        if ( pWindowList[v3].field_30 != 0 )   //crashed at skill draw
+        {
+          pMouse->GetClickPos(&uClickX, &uClickY);
+          v29 = pWindowList[v3].pStartingPosActiveItem + pWindowList[v3].pNumPresenceButton; //num buttons more than buttons 
+          for ( v4 = pWindowList[v3].pStartingPosActiveItem; v4 < v29; ++v4 )
+          {
+            pButton = pWindowList[v3].pControlsHead;
+            if ( v4 > 0 )
+            {
+              for ( v15 = v4; v15; --v15 )
+                pButton = pButton->pNext;
+            }
+            if ( (signed int)uClickX >= (signed int)pButton->uX && (signed int)uClickX <= (signed int)pButton->uZ
+              && (signed int)uClickY >= (signed int)pButton->uY && (signed int)uClickY <= (signed int)pButton->uW )
+            {
+              pWindowList[v3].pCurrentPosActiveItem = v4;
+              return true;
+            }
+          }
+        }
         break;
       }
       default:
--- a/mm7_2.cpp	Fri Dec 13 16:10:36 2013 +0600
+++ b/mm7_2.cpp	Fri Dec 13 17:46:37 2013 +0600
@@ -2814,16 +2814,11 @@
 //----- (004610AA) --------------------------------------------------------
 void __fastcall PrepareToLoadODM(unsigned int bLoading, ODMRenderParams *a2)
 {
-  unsigned int v2; // edi@1
-  ODMRenderParams *v3; // esi@1
-
-  v2 = bLoading;
-  v3 = a2;
   pGameLoadingUI_ProgressBar->Reset(27);
   pSoundList->_4A9D79(0);
   uCurrentlyLoadedLevelType = LEVEL_Outdoor;
-  ODM_LoadAndInitialize(pCurrentMapName, v3);
-  if ( !v2 )
+  ODM_LoadAndInitialize(pCurrentMapName, a2);
+  if ( !bLoading )
     TeleportToStartingPoint(uLevel_StartingPointType);
   viewparams->_443365();
   PlayLevelMusic();
@@ -2857,11 +2852,9 @@
   int v21[16]; // [sp+1Ch] [bp-40h]@17
 
   GenerateItemsInChest();
-  //v0 = pGameLoadingUI_ProgressBar;
   pGameLoadingUI_ProgressBar->Progress();
   pParty->uFlags |= 2u;
   pParty->field_7B5_in_arena_quest = 0;
-  //v1 = 0;
   dword_5C6DF8 = 1;
   pNPCStats->uNewlNPCBufPos = 0;
   v19 = pMapStats->GetMapInfo(pCurrentMapName);
@@ -2870,42 +2863,42 @@
   for (uint i = 0; i < uNumActors; ++i)
   //if ( (signed int)uNumActors > 0 )
   {
-    Actor* pActor = &pActors[i];
+    //Actor* pActor = &pActors[i];
     //v2 = (char *)&pActors[0].uNPC_ID;
     //do
     //{
-      v3 = pActor->pMonsterInfo.uID;
+      v3 = pActors[i].pMonsterInfo.uID;
       v17 = 0;
-      if ( pActor->pMonsterInfo.uID >= 115 && pActor->pMonsterInfo.uID <= 186
-        || pActor->pMonsterInfo.uID >= 232 && pActor->pMonsterInfo.uID <= 249 )
+      if ( pActors[i].pMonsterInfo.uID >= 115 && pActors[i].pMonsterInfo.uID <= 186
+        || pActors[i].pMonsterInfo.uID >= 232 && pActors[i].pMonsterInfo.uID <= 249 )
         v17 = 1;
       //v1 = 0;
       v4 = (v3 - 1) % 3;
       if ( 2 == v4 )
       {
-        if ( pActor->sNPC_ID && pActor->sNPC_ID < 5000 )
+        if ( pActors[i].sNPC_ID && pActors[i].sNPC_ID < 5000 )
           continue;
       }
       else
       {
         if ( v4 != 1 )
         {
-          if ( v4 == 0 && pActor->sNPC_ID == 0 )
-			pActor->sNPC_ID = 0;
+          if ( v4 == 0 && pActors[i].sNPC_ID == 0 )
+			pActors[i].sNPC_ID = 0;
 		  continue;
         }
       }
-      if ( pActor->sNPC_ID > 0 && pActor->sNPC_ID < 5000 )
+      if ( pActors[i].sNPC_ID > 0 && pActors[i].sNPC_ID < 5000 )
         continue;
       if ( v17 )
       {
         pNPCStats->InitializeAdditionalNPCs(&pNPCStats->pAdditionalNPC[pNPCStats->uNewlNPCBufPos], v3, 0, v19);
         v14 = LOWORD(pNPCStats->uNewlNPCBufPos) + 5000;
         ++pNPCStats->uNewlNPCBufPos;
-        pActor->sNPC_ID = v14;
+        pActors[i].sNPC_ID = v14;
         continue;
       }
-      pActor->sNPC_ID = 0;
+      pActors[i].sNPC_ID = 0;
       //++v15;
       //v2 += 836;
     //}
@@ -2921,7 +2914,6 @@
 
   for (uint i = 0; i < uNumActors; ++i)
   {
-    Actor* pActor = &pActors[i];
     //v7 = (char *)&pActors[0].pMonsterInfo;
     //do
     //{
@@ -2930,7 +2922,7 @@
       {
         do
         {
-          if ( v21[v8] == pActor->pMonsterInfo.uID - 1 )
+          if ( v21[v8] == pActors[i].pMonsterInfo.uID - 1 )
             break;
           ++v8;
         }
@@ -2939,7 +2931,7 @@
 
       if ( v8 == v6 )
       {
-        v21[v6++] = pActor->pMonsterInfo.uID - 1;
+        v21[v6++] = pActors[i].pMonsterInfo.uID - 1;
         v20 = v6;
         if ( v6 == 16 )
           break;