changeset 787:3a77fbf7d0b8

GetSector
author Ritor1
date Mon, 25 Mar 2013 02:20:57 +0600
parents da80bd2922df
children f004c7ceb7bd
files Events.cpp Indoor.cpp mm7_3.cpp
diffstat 3 files changed, 30 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/Events.cpp	Sun Mar 24 09:19:36 2013 +0600
+++ b/Events.cpp	Mon Mar 25 02:20:57 2013 +0600
@@ -1065,8 +1065,9 @@
 				v11 = (unsigned __int8)*(&_evt->v5 + rand() % ((_evt->v5 != 0) + (_evt->v6 != 0) + (_evt->v7 != 0) + (_evt->v8 != 0) + (_evt->v9 != 0)
 					+ (_evt->v10 != 0)));
                 curr_seq_num = v11 - 1;
-                   ++curr_seq_num;
-                   v4 = v124;
+                ++curr_seq_num;
+                v4 = v124;
+                break;
 			case EVENT_ReceiveDamage:
 				v85 = EVT_DWORD(_evt->v7 );
 				v86 = _evt->v5;
--- a/Indoor.cpp	Sun Mar 24 09:19:36 2013 +0600
+++ b/Indoor.cpp	Mon Mar 25 02:20:57 2013 +0600
@@ -3208,7 +3208,7 @@
                v59 = pVertices[pFace->pVertexIDs[0]].y >= sY;
 
                         //v21 = pFace->pVertexIDs + 1;
-               for (uint k = 1; k < pFace->uNumVertices; ++k)
+               for (uint k = 0; k < pFace->uNumVertices; k++)
                {
                  if (v54 >= 2)
                    break;
@@ -3218,10 +3218,10 @@
                           //v22 = pVertex->y;
                           //v47 = pVertex->y;
                  v50 = v2->y >= sY;
-                 if ( v59 ^ v50 )
+                 if ( v59 != v50 )
                  {
                             //v58 = &pVertices[pFace->pVertexIDs[k - 1]];
-                   auto v1 = &pVertices[pFace->pVertexIDs[k - 1]];
+                   auto v1 = &pVertices[pFace->pVertexIDs[k]];
                             //v23 = v58->x;
                             //HIWORD(v24) = HIWORD(v49);
                             //LOWORD(v24) = v49->x;
@@ -3259,7 +3259,7 @@
                         _a58 = v33 / (v2->y - v1->y);
                         _a59 = (unsigned __int64)(_a58 * (signed __int64)(sY - v1->y)) >> 16;
 
-                        if (_a59 + pVertices[k - 1].x > sX)
+                        if (_a59 + pVertices[k].x > sX)
                           ++v54;
                       }
                     }
--- a/mm7_3.cpp	Sun Mar 24 09:19:36 2013 +0600
+++ b/mm7_3.cpp	Mon Mar 25 02:20:57 2013 +0600
@@ -13532,7 +13532,7 @@
   int v1; // ebp@1
   unsigned int v2; // ebx@4
   unsigned int v3; // edi@4
-  char *v4; // esi@6
+  char *pField_C; // esi@6
   __int16 v5; // ax@8
   int v6; // ecx@10
   unsigned int v7; // ebp@12
@@ -13557,41 +13557,41 @@
       v12 = 0;
       if ( dword_5B65C8_timers_count > 0 )
       {
-        v4 = (char *)&array_5B5928_timers[0].field_C;
+        pField_C = (char *)&array_5B5928_timers[0].field_C;
         while ( 1 )
         {
-          v5 = *(short *)v4;
-          if ( *(short *)v4 != (short)v1 )
+          v5 = *(short *)pField_C;
+          if ( *(short *)pField_C != (short)v1 )
             break;
-          v7 = *((int *)v4 - 2);
-          if ( v7 <= v3 && (v7 < v3 || *((int *)v4 - 3) <= v2) )
-          {
-            if ( *((short *)v4 + 2) )
+          v7 = *((int *)pField_C - 2);
+          if ( v7 <= v3 && (v7 < v3 || *((int *)pField_C - 3) <= v2) )
+          {
+            if ( *((short *)pField_C + 2) )
             {
               v8 = 29030400;
             }
             else
             {
-              if ( *((short *)v4 + 3) )
+              if ( *((short *)pField_C + 3) )
               {
                 v8 = 2419200;
               }
               else
               {
-                v9 = -(*((short *)v4 + 4) != 0);
+                v9 = -(*((short *)pField_C + 4) != 0);
                 v8 = (v9 & 0x7E900) + 86400;
               }
             }
-            v10 = v7 + *((int *)v4 - 3) + (signed __int64)((double)((signed __int64)v8 << 7) * 0.033333335);//v10 = __PAIR__(v7, *((int *)v4 - 3)) + (signed __int64)((double)((signed __int64)v8 << 7) * 0.033333335);
-            *((int *)v4 - 3) = v10;
-            *((int *)v4 - 2) = HIDWORD(v10);
-            if ( HIDWORD(v10) <= v3 && (HIDWORD(v10) < v3 || *((int *)v4 - 3) < v2) )
+            v10 = v7 + *((int *)pField_C - 3) + (signed __int64)((double)((signed __int64)v8 << 7) * 0.033333335);//v10 = __PAIR__(v7, *((int *)v4 - 3)) + (signed __int64)((double)((signed __int64)v8 << 7) * 0.033333335);
+            *((int *)pField_C - 3) = v10;
+            *((int *)pField_C - 2) = HIDWORD(v10);
+            if ( HIDWORD(v10) <= v3 && (HIDWORD(v10) < v3 || *((int *)pField_C - 3) < v2) )
             {
-              *((int *)v4 - 3) = v2;
-              *((int *)v4 - 2) = v3;
+              *((int *)pField_C - 3) = v2;
+              *((int *)pField_C - 2) = v3;
             }
-            v11 = *((short *)v4 - 2);
-            start_event_seq_number = *((short *)v4 - 1);
+            v11 = *((short *)pField_C - 2);
+            start_event_seq_number = *((short *)pField_C - 1);
             EventProcessor(v11, 0, 1);
             start_event_seq_number = 0;
 LABEL_25:
@@ -13600,19 +13600,19 @@
           }
 LABEL_26:
           ++v12;
-          v4 += 32;
+          pField_C += 32;
           if ( v12 >= dword_5B65C8_timers_count )
             return;
           v1 = 0;
         }
         if ( v13 < v5 )
         {
-          *(short *)v4 = v5 - v13;
+          *(short *)pField_C = v5 - v13;
           goto LABEL_26;
         }
-        v6 = *((short *)v4 - 2);
-        *(short *)v4 = *((short *)v4 + 1);
-        start_event_seq_number = *((short *)v4 - 1);
+        v6 = *((short *)pField_C - 2);
+        *(short *)pField_C = *((short *)pField_C + 1);
+        start_event_seq_number = *((short *)pField_C - 1);
         EventProcessor(v6, 0, 1);
         start_event_seq_number = v1;
         goto LABEL_25;