diff mm7_3.cpp @ 695:af0332a32034

sub_444564 clean and fix right click on map screen
author zipi
date Sun, 17 Mar 2013 11:59:37 +0000
parents e0a1fccc89b1
children d6236f6a9882 a5ee769b02c6
line wrap: on
line diff
--- a/mm7_3.cpp	Sun Mar 17 12:47:19 2013 +0400
+++ b/mm7_3.cpp	Sun Mar 17 11:59:37 2013 +0000
@@ -13381,11 +13381,9 @@
   int v1; // ebx@3
   int v2; // edi@3
   int v3; // eax@3
-  int v4; // esi@5
   int v5; // edi@6
   int v6; // eax@6
   int v7; // eax@6
-  BSPModel **v8; // ecx@6
   unsigned __int8 v9; // zf@7
   unsigned __int8 v10; // sf@7
   ODMFace *v11; // eax@9
@@ -13397,7 +13395,7 @@
   const char *v17; // [sp+4h] [bp-1Ch]@3
   unsigned int pY; // [sp+8h] [bp-18h]@3
   float v19; // [sp+Ch] [bp-14h]@1
-  int v20; // [sp+10h] [bp-10h]@1
+  int v20;
   int v21; // [sp+14h] [bp-Ch]@1
   unsigned int v22; // [sp+18h] [bp-8h]@8
   int pX; // [sp+1Ch] [bp-4h]@3
@@ -13418,29 +13416,25 @@
   LODWORD(v19) = (signed __int64)((double)v21 - (double)(signed int)(pY - 181) * v0);
   v2 = abs(v1 + 22528) / 512;
   v3 = abs((signed)LODWORD(v19) - 22528);
+  result = 0;
   if ( pOutdoor->_47F04C(v2, v3 / 512)
     && uCurrentlyLoadedLevelType == LEVEL_Outdoor
-    && (v4 = 0, v20 = 0, (signed int)v16 > 0) )
-  {
-    while ( 1 )
-    {
-      pX = *(int *)((char *)&pOutdoor->pBModels[v4].vBoundingCenter.x) - v1;
-      pY = *(int *)((char *)&pOutdoor->pBModels[v4].vBoundingCenter.y) - LODWORD(v19);
+    && (signed int)v16 > 0 )
+  {
+	for(int i = 0; i < pOutdoor->uNumBModels && !v17; i++)
+    {
+      pX = pOutdoor->pBModels[i].vBoundingCenter.x - v1;
+      pY = pOutdoor->pBModels[i].vBoundingCenter.y - LODWORD(v19);
       v5 = abs((signed)pY);
       v6 = abs((signed)pX);
       v7 = int_get_vector_length(v6, v5, 0);
-      v8 = &pOutdoor->pBModels;
-      if ( v7 < *(int *)((char *)&pOutdoor->pBModels[v4].sBoundingRadius) )
-      {
-        v9 = pOutdoor->pBModels[v4].uNumFaces == 0;
-        v10 = pOutdoor->pBModels[v4].uNumFaces < 0;
-        v21 = 0;
-        if ( !(v10 | v9) )
-        {
-          v22 = 0;
-          do
-          {
-            v11 = &v8[v4]->pFaces[v22 / 0x134];
+      if ( v7 < pOutdoor->pBModels[i].sBoundingRadius )
+      {
+        if ( pOutdoor->pBModels[i].uNumFaces > 0 )
+        {
+		  for(int j = 0; j < pOutdoor->pBModels[i].uNumFaces; j++)
+          {
+			v11 = &pOutdoor->pBModels[i].pFaces[j];//&v8[v4]->pFaces[v22 / 0x134];
             v12 = v11->sCogTriggeredID;
             if ( v12 )
             {
@@ -13455,26 +13449,11 @@
                 }
               }
             }
-            ++v21;
-            v8 = &pOutdoor->pBModels;
-            v22 += 308;
-          }
-          while ( v21 < pOutdoor->pBModels[v4].uNumFaces );
+          }
         }
         result = v17;
-        if ( v17 )
-          break;
-      }
-      ++v20;
-      v4 += 188;
-      if ( v20 >= (signed int)v16 )
-        goto LABEL_17;
-    }
-  }
-  else
-  {
-LABEL_17:
-    result = 0;
+      }
+    }
   }
   return result;
 }