changeset 2204:23e7c7299ea8

sub_407A1C cleaning continue
author Ritor1
date Wed, 05 Feb 2014 00:59:33 +0600
parents 4bfee77e900d
children db94443ea4e7
files Indoor.cpp mm7_3.cpp
diffstat 2 files changed, 294 insertions(+), 295 deletions(-) [+]
line wrap: on
line diff
--- a/Indoor.cpp	Tue Feb 04 17:29:04 2014 +0600
+++ b/Indoor.cpp	Wed Feb 05 00:59:33 2014 +0600
@@ -411,12 +411,12 @@
   _this.pTargetZ = pRenderer->pActiveZBuffer;*/
 
   //sub_440BED(&_this); -- inlined
-  {
+  //{
     PrepareDrawLists_BLV();
     if (pBLVRenderParams->uPartySectorID)
       IndoorLocation::ExecDraw(true/*pRenderer->pRenderD3D != 0*/);
     pRenderer->DrawBillboardList_BLV();
-  }
+  //}
 
   pParty->uFlags &= ~2;
   pGame->DrawParticles();
@@ -509,7 +509,7 @@
     return;
   
   ++pBLVRenderParams->uNumFacesRenderedThisFrame;
-  pFace->uAttributes |= 0x80u;
+  pFace->uAttributes |= 0x80;
 
   if (!pFace->GetTexture())
     return;
@@ -787,7 +787,6 @@
   }
 }
 
-
 //----- (004AE5BA) --------------------------------------------------------
 Texture *BLVFace::GetTexture()
 {
@@ -804,46 +803,46 @@
 //----- (00498B15) --------------------------------------------------------
 void IndoorLocation::Release()
 {
-  IndoorLocation *v1; // esi@1
-  char *v2; // ebp@1
-  void *v3; // ST00_4@1
-
-  v1 = this;
-  v2 = (char *)&this->ptr_0002B4_doors_ddata;
+  //IndoorLocation *v1; // esi@1
+  //char *v2; // ebp@1
+  //void *v3; // ST00_4@1
+
+  //v1 = this;
+  //v2 = (char *)&this->ptr_0002B4_doors_ddata;
   free(this->ptr_0002B4_doors_ddata);
-  *(int *)v2 = 0;
-  free(v1->ptr_0002B0_sector_rdata);
-  v1->ptr_0002B0_sector_rdata = 0;
-  free(v1->ptr_0002B8_sector_lrdata);
-  v1->ptr_0002B8_sector_lrdata = 0;
-  free(v1->pLFaces);
-  v1->pLFaces = 0;
-  free(v1->pSpawnPoints);
-  v3 = v1->pVertices;
-  v1->pSpawnPoints = 0;
-  v1->uNumSectors = 0;
-  v1->uNumFaces = 0;
-  v1->uNumVertices = 0;
-  v1->uNumNodes = 0;
-  v1->uNumDoors = 0;
-  v1->uNumLights = 0;
-  free(v3);
-  free(v1->pFaces);
-  free(v1->pFaceExtras);
-  free(v1->pSectors);
-  free(v1->pLights);
-  free(v1->pDoors);
-  free(v1->pNodes);
-  free(v1->pMapOutlines);
-  v1->pVertices = 0;
-  v1->pFaces = 0;
-  v1->pFaceExtras = 0;
-  v1->pSectors = 0;
-  v1->pLights = 0;
-  v1->pDoors = 0;
-  v1->pNodes = 0;
-  v1->pMapOutlines = 0;
-  v1->bLoaded = 0;
+  this->ptr_0002B4_doors_ddata = 0;
+  free(this->ptr_0002B0_sector_rdata);
+  this->ptr_0002B0_sector_rdata = 0;
+  free(this->ptr_0002B8_sector_lrdata);
+  this->ptr_0002B8_sector_lrdata = 0;
+  free(this->pLFaces);
+  this->pLFaces = 0;
+  free(this->pSpawnPoints);
+  //v3 = this->pVertices;
+  this->pSpawnPoints = 0;
+  this->uNumSectors = 0;
+  this->uNumFaces = 0;
+  this->uNumVertices = 0;
+  this->uNumNodes = 0;
+  this->uNumDoors = 0;
+  this->uNumLights = 0;
+  free(this->pVertices);
+  free(this->pFaces);
+  free(this->pFaceExtras);
+  free(this->pSectors);
+  free(this->pLights);
+  free(this->pDoors);
+  free(this->pNodes);
+  free(this->pMapOutlines);
+  this->pVertices = 0;
+  this->pFaces = 0;
+  this->pFaceExtras = 0;
+  this->pSectors = 0;
+  this->pLights = 0;
+  this->pDoors = 0;
+  this->pNodes = 0;
+  this->pMapOutlines = 0;
+  this->bLoaded = 0;
 }
 
 //----- (00498C45) --------------------------------------------------------
@@ -875,8 +874,6 @@
   }
 }
 
-
-
 //----- (00444810) --------------------------------------------------------
 unsigned int IndoorLocation::GetLocationIndex(const char *Str1)
 {
@@ -889,8 +886,6 @@
   return 0;
 }
 
-
-
 //----- (004488F7) --------------------------------------------------------
 void IndoorLocation::ToggleLight(signed int sLightID, unsigned int bToggle)
 {
@@ -904,7 +899,6 @@
   }
 }
 
-
 //----- (00498E0A) --------------------------------------------------------
 bool IndoorLocation::Load(char *pFilename, int a3, size_t _i, char *pDest)
 {
@@ -4435,7 +4429,7 @@
   int v36; // ebx@39
   int v37; // edx@41
   char *v38; // edi@51
-  ODMFace *v39; // esi@54
+  ODMFace *odm_face; // esi@54
   int v40; // ebx@60
   int v41; // eax@61
   signed int v42; // edi@61
@@ -4577,7 +4571,7 @@
   int v_4c; // [sp+8Ch] [bp+10h]@141
   int v_8; // [sp+90h] [bp+14h]@53
 
-  //__debugbreak();
+  //__debugbreak();срабатывает при стрельбе огненным шаром
 
   v4 = stru_5C6E00->Atan2(v.x - x, v.y - z);
   v114 = 0;
@@ -4586,7 +4580,7 @@
   v97.y = z;
   v113 = 0;
   a4_8 = v4;
-  if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor)
+  if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
   {
     Vec3_int_::Rotate(32, stru_5C6E00->uIntegerHalfPi + v4, 0, v97, &pOut.x, &pOut.y, &outz);
     v45.z = v.z;
@@ -4892,262 +4886,267 @@
         goto LABEL_148;
     }
   }
-  Vec3_int_::Rotate(32, stru_5C6E00->uIntegerHalfPi + v4, 0, v97, &pOut.x, &pOut.y, &outz);
-  v5.z = v.z;
-  v5.x = v.x;
-  v5.y = v.y;
-  Vec3_int_::Rotate(32, stru_5C6E00->uIntegerHalfPi + v4, 0, v5, &outx, &outy, &v163);
-  v6 = outy - pOut.y;
-  v7 = v163 - outz;
-  v8 = outx - pOut.x;
-  v9 = integer_sqrt(v8 * v8 + v6 * v6 + v7 * v7);
-  v10 = 65536;
-  if ( v9 )
-    v10 = 65536 / v9;
-  v125 = v8 * v10;
-  v11 = v10;
-  v12 = v7 * v10;
-  v13 = pOut.x;
-  v117 = v12;
-  v121 = v6 * v11;
-  v149 = pOut.x;
-  if ( pOut.x < outx )
-    v145 = outx;
-  else
+  else if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
   {
-    v149 = outx;
-    v145 = pOut.x;
-  }
-  v14 = outy;
-  v141 = pOut.y;
-  if ( pOut.y < outy )
-    v137 = outy;
-  else
-  {
-    v141 = outy;
-    v137 = pOut.y;
-  }
-  v133 = outz;
-  if ( outz < v163 )
-    v129 = v163;
-  else
-  {
-    v133 = v163;
-    v129 = outz;
-  }
-  v160 = 0;
-  if ( (signed int)pOutdoor->uNumBModels > 0 )
-  {
-    v104 = 0;
-    while ( 1 )
+    Vec3_int_::Rotate(32, stru_5C6E00->uIntegerHalfPi + v4, 0, v97, &pOut.x, &pOut.y, &outz);
+    v5.z = v.z;
+    v5.x = v.x;
+    v5.y = v.y;
+    Vec3_int_::Rotate(32, stru_5C6E00->uIntegerHalfPi + v4, 0, v5, &outx, &outy, &v163);
+    v6 = outy - pOut.y;
+    v7 = v163 - outz;
+    v8 = outx - pOut.x;
+    v9 = integer_sqrt(v8 * v8 + v6 * v6 + v7 * v7);
+    v10 = 65536;
+    if ( v9 )
+      v10 = 65536 / v9;
+    v125 = v8 * v10;
+    v11 = v10;
+    v12 = v7 * v10;
+    v13 = pOut.x;
+    v117 = v12;
+    v121 = v6 * v11;
+    v149 = pOut.x;
+    if ( pOut.x < outx )
+      v145 = outx;
+    else
+    {
+      v149 = outx;
+      v145 = pOut.x;
+    }
+    v14 = outy;
+    v141 = pOut.y;
+    if ( pOut.y < outy )
+      v137 = outy;
+    else
     {
-      v15 = (char *)&pOutdoor->pBModels[v104].pVertices;
-      a5 = (char *)&pOutdoor->pBModels[v104].pVertices;
-      if ( sub_4088E9(v13, pOut.y, outx, v14, pOutdoor->pBModels[v104].vPosition.x, pOutdoor->pBModels[v104].vPosition.y) <= pOutdoor->pBModels[v104].sBoundingRadius + 128 )
+      v141 = outy;
+      v137 = pOut.y;
+    }
+    v133 = outz;
+    if ( outz < v163 )
+      v129 = v163;
+    else
+    {
+      v133 = v163;
+      v129 = outz;
+    }
+    v160 = 0;
+    if ( (signed int)pOutdoor->uNumBModels > 0 )
+    {
+      v104 = 0;
+      while ( 1 )
       {
-        sDepth = 0;
-        if ( *((int *)v15 + 2) > 0 )
-          break;
+        v15 = (char *)&pOutdoor->pBModels[v104].pVertices;
+        a5 = (char *)&pOutdoor->pBModels[v104].pVertices;
+        if ( sub_4088E9(v13, pOut.y, outx, v14, pOutdoor->pBModels[v104].vPosition.x, pOutdoor->pBModels[v104].vPosition.y) <= pOutdoor->pBModels[v104].sBoundingRadius + 128 )
+        {
+          sDepth = 0;
+          if ( *((int *)v15 + 2) > 0 )
+            break;
+        }
+LABEL_36:
+        ++v160;
+        ++v104;
+        if ( v160 >= (signed int)pOutdoor->uNumBModels )
+          goto LABEL_37;
+        v14 = outy;
+        v13 = pOut.x;
       }
-LABEL_36:
-      ++v160;
-      ++v104;
-      if ( v160 >= (signed int)pOutdoor->uNumBModels )
-        goto LABEL_37;
-      v14 = outy;
-      v13 = pOut.x;
-    }
-    v106 = 0;
-    while ( 1 )
-    {
-      v16 = (ODMFace *)(v106 + *((int *)a5 + 4));
-      if ( v149 > v16->pBoundingBox.x2
-        || v145 < v16->pBoundingBox.x1
-        || v141 > v16->pBoundingBox.y2
-        || v137 < v16->pBoundingBox.y1
-        || v133 > v16->pBoundingBox.z2
-        || v129 < v16->pBoundingBox.z1
-        || (v17 = fixpoint_mul(v125, v16->pFacePlane.vNormal.x),
-            v18 = fixpoint_mul(v121, v16->pFacePlane.vNormal.y),
-            v19 = fixpoint_mul(v117, v16->pFacePlane.vNormal.z),
-            v20 = v17 + v18 + v19 == 0,
-            v21 = v17 + v18 + v19,
-            v109 = v17 + v18 + v19,
-            v20) )
-        goto LABEL_33;
-      v22 = pOut.y * v16->pFacePlane.vNormal.y;
-      v23 = -(v16->pFacePlane.dist + v22 + outz * v16->pFacePlane.vNormal.z + pOut.x * v16->pFacePlane.vNormal.x);
-      if ( v21 <= 0 )
-      {
-        if ( v16->pFacePlane.dist + v22 + outz * v16->pFacePlane.vNormal.z + pOut.x * v16->pFacePlane.vNormal.x < 0 )
-          goto LABEL_33;
-      }
-      else
-      {
-        if ( v16->pFacePlane.dist + v22 + outz * v16->pFacePlane.vNormal.z + pOut.x * v16->pFacePlane.vNormal.x > 0 )
-          goto LABEL_33;
-      }
-      v24 = abs(-(v16->pFacePlane.dist + v22 + outz * v16->pFacePlane.vNormal.z + pOut.x * v16->pFacePlane.vNormal.x)) >> 14;
-      if ( v24 <= abs(v21) )
-      {
-        //LODWORD(v25) = v23 << 16;
-        //HIDWORD(v25) = v23 >> 16;
-        //v26 = v25 / v109;
-        //v110 = v25 / v109;
-        v110 = fixpoint_div(v23, v109);
-        if ( v110 >= 0 )
+      v106 = 0;
+      while ( 1 )
+     {
+       odm_face = (ODMFace *)(v106 + *((int *)a5 + 4));
+       if ( v149 > odm_face->pBoundingBox.x2
+         || v145 < odm_face->pBoundingBox.x1
+         || v141 > odm_face->pBoundingBox.y2
+         || v137 < odm_face->pBoundingBox.y1
+         || v133 > odm_face->pBoundingBox.z2
+         || v129 < odm_face->pBoundingBox.z1
+         || (v17 = fixpoint_mul(v125, odm_face->pFacePlane.vNormal.x),
+             v18 = fixpoint_mul(v121, odm_face->pFacePlane.vNormal.y),
+             v19 = fixpoint_mul(v117, odm_face->pFacePlane.vNormal.z),
+             v20 = v17 + v18 + v19 == 0,
+             v21 = v17 + v18 + v19,
+             v109 = v17 + v18 + v19,
+             v20) )
+         goto LABEL_33;
+        //v22 = pOut.y * odm_face->pFacePlane.vNormal.y;
+        v23 = -(odm_face->pFacePlane.dist + pOut.y * odm_face->pFacePlane.vNormal.y
+                                          + outz * odm_face->pFacePlane.vNormal.z
+                                          + pOut.x * odm_face->pFacePlane.vNormal.x);
+        if ( v21 <= 0 )
         {
-          if ( sub_4077F1(
-                 pOut.x + ((signed int)(fixpoint_mul(v110, v125) + 32768) >> 16),
-                 pOut.y + ((signed int)(fixpoint_mul(v110, v121) + 32768) >> 16),
-                 outz + ((signed int)(fixpoint_mul(v110, v117) + 32768) >> 16),
-                 v16,
-                 (BSPVertexBuffer *)a5) )
+          if ( odm_face->pFacePlane.dist + pOut.y * odm_face->pFacePlane.vNormal.y 
+                                         + outz * odm_face->pFacePlane.vNormal.z 
+                                         + pOut.x * odm_face->pFacePlane.vNormal.x < 0 )
+            goto LABEL_33;
+        }
+        else
+        {
+          if ( odm_face->pFacePlane.dist + pOut.y * odm_face->pFacePlane.vNormal.y
+                                         + outz * odm_face->pFacePlane.vNormal.z 
+                                         + pOut.x * odm_face->pFacePlane.vNormal.x > 0 )
+            goto LABEL_33;
+        }
+        v24 = abs(-(odm_face->pFacePlane.dist + pOut.y * odm_face->pFacePlane.vNormal.y 
+                                              + outz * odm_face->pFacePlane.vNormal.z 
+                                              + pOut.x * odm_face->pFacePlane.vNormal.x)) >> 14;
+        if ( v24 <= abs(v21) )
+        {
+          //LODWORD(v25) = v23 << 16;
+          //HIDWORD(v25) = v23 >> 16;
+          //v26 = v25 / v109;
+          //v110 = v25 / v109;
+          v110 = fixpoint_div(v23, v109);
+          if ( v110 >= 0 )
           {
-            v114 = 1;
-            goto LABEL_36;
+            if ( sub_4077F1(pOut.x + ((signed int)(fixpoint_mul(v110, v125) + 32768) >> 16),
+                            pOut.y + ((signed int)(fixpoint_mul(v110, v121) + 32768) >> 16),
+                              outz + ((signed int)(fixpoint_mul(v110, v117) + 32768) >> 16),
+                   odm_face,
+                   (BSPVertexBuffer *)a5) )
+            {
+              v114 = 1;
+              goto LABEL_36;
+            }
           }
         }
+LABEL_33:
+        ++sDepth;
+        v106 += 308;
+        if ( sDepth >= *((int *)a5 + 2) )
+          goto LABEL_36;
       }
-LABEL_33:
-      ++sDepth;
-      v106 += 308;
-      if ( sDepth >= *((int *)a5 + 2) )
-        goto LABEL_36;
     }
-  }
 LABEL_37:
-  v27.z = y;
-  v27.x = x;
-  v27.y = z;
-  Vec3_int_::Rotate(32, a4_8 - stru_5C6E00->uIntegerHalfPi, 0, v27, &pOut.x, &pOut.y, &outz);
-  v28.z = v.z;
-  v28.x = v.x;
-  v28.y = v.y;
-  Vec3_int_::Rotate(32, a4_8 - stru_5C6E00->uIntegerHalfPi, 0, v28, &outx, &outy, &v163);
-  v29 = outy - pOut.y;
-  v30 = v163 - outz;
-  v31 = outx - pOut.x;
-  v32 = integer_sqrt(v31 * v31 + v29 * v29 + v30 * v30);
-  v33 = 65536;
-  if ( v32 )
-    v33 = 65536 / v32;
-  v126 = v31 * v33;
-  v34 = v33;
-  v35 = v30 * v33;
-  v36 = pOut.x;
-  v118 = v35;
-  v122 = v29 * v34;
-  v150 = pOut.x;
-  if ( pOut.x < outx )
-  {
-    v146 = outx;
-  }
-  else
-  {
-    v150 = outx;
-    v146 = pOut.x;
-  }
-  v37 = outy;
-  v142 = pOut.y;
-  if ( pOut.y < outy )
-  {
-    v138 = outy;
-  }
-  else
-  {
-    v142 = outy;
-    v138 = pOut.y;
-  }
-  v134 = outz;
-  if ( outz < v163 )
-  {
-    v130 = v163;
-  }
-  else
-  {
-    v134 = v163;
-    v130 = outz;
-  }
-  v161 = 0;
-  if ( (signed int)pOutdoor->uNumBModels > 0 )
-  {
-    v105 = 0;
-    while ( 1 )
+    v27.z = y;
+    v27.x = x;
+    v27.y = z;
+    Vec3_int_::Rotate(32, a4_8 - stru_5C6E00->uIntegerHalfPi, 0, v27, &pOut.x, &pOut.y, &outz);
+    v28.z = v.z;
+    v28.x = v.x;
+    v28.y = v.y;
+    Vec3_int_::Rotate(32, a4_8 - stru_5C6E00->uIntegerHalfPi, 0, v28, &outx, &outy, &v163);
+    v29 = outy - pOut.y;
+    v30 = v163 - outz;
+    v31 = outx - pOut.x;
+    v32 = integer_sqrt(v31 * v31 + v29 * v29 + v30 * v30);
+    v33 = 65536;
+    if ( v32 )
+      v33 = 65536 / v32;
+    v126 = v31 * v33;
+    v34 = v33;
+    v35 = v30 * v33;
+    v36 = pOut.x;
+    v118 = v35;
+    v122 = v29 * v34;
+    v150 = pOut.x;
+    if ( pOut.x < outx )
+      v146 = outx;
+    else
+    {
+      v150 = outx;
+      v146 = pOut.x;
+    }
+    v37 = outy;
+    v142 = pOut.y;
+    if ( pOut.y < outy )
+      v138 = outy;
+    else
+    {
+      v142 = outy;
+      v138 = pOut.y;
+    }
+    v134 = outz;
+    if ( outz < v163 )
+      v130 = v163;
+    else
+    {
+      v134 = v163;
+      v130 = outz;
+    }
+    //v161 = 0;
+    if ( (signed int)pOutdoor->uNumBModels > 0 )
     {
-      v38 = (char *)&pOutdoor->pBModels[v105].pVertices;
-      a5a = (char *)&pOutdoor->pBModels[v105].pVertices;
-      if ( sub_4088E9(v36, pOut.y, outx, v37, pOutdoor->pBModels[v105].vPosition.x, pOutdoor->pBModels[v105].vPosition.y) <= pOutdoor->pBModels[v105].sBoundingRadius + 128 )
+      v105 = 0;
+      //while ( 1 )
+      for ( v161 = 0; v161 < (signed int)pOutdoor->uNumBModels; ++v161 )
       {
-        sDeptha = 0;
-        if ( *((int *)v38 + 2) > 0 )
-          break;
+        v38 = (char *)&pOutdoor->pBModels[v105].pVertices;
+        a5a = (char *)&pOutdoor->pBModels[v105].pVertices;
+        if ( sub_4088E9(v36, pOut.y, outx, v37, pOutdoor->pBModels[v105].vPosition.x, pOutdoor->pBModels[v105].vPosition.y) <= pOutdoor->pBModels[v105].sBoundingRadius + 128 )
+        {
+         
+          if ( *((int *)v38 + 2) > 0 )
+		  {
+            //v_8 = 0;
+            //while ( 1 )
+			for ( sDeptha = 0; sDeptha < *((int *)a5a + 2); ++sDeptha )
+            {
+              odm_face = &pOutdoor->pBModels[v105].pFaces[sDeptha];
+              if ( v150 > odm_face->pBoundingBox.x2
+                || v146 < odm_face->pBoundingBox.x1
+                || v142 > odm_face->pBoundingBox.y2
+                || v138 < odm_face->pBoundingBox.y1
+                || v134 > odm_face->pBoundingBox.z2
+                || v130 < odm_face->pBoundingBox.z1
+                || (ya = fixpoint_mul(v126, odm_face->pFacePlane.vNormal.x),
+                    ve = fixpoint_mul(v122, odm_face->pFacePlane.vNormal.y),
+                    v_4 = fixpoint_mul(v118, odm_face->pFacePlane.vNormal.z),
+                    v20 = ya + ve + v_4 == 0,
+                    v40 = ya + ve + v_4,
+                    va = ya + ve + v_4,
+                    v20) )
+                goto LABEL_68;
+              v41 = pOut.y * odm_face->pFacePlane.vNormal.y;
+              v42 = -(odm_face->pFacePlane.dist + v41 + outz * odm_face->pFacePlane.vNormal.z + pOut.x * odm_face->pFacePlane.vNormal.x);
+              if ( v40 <= 0 )
+              {
+                if ( odm_face->pFacePlane.dist + v41 + outz * odm_face->pFacePlane.vNormal.z + pOut.x * odm_face->pFacePlane.vNormal.x < 0 )
+                  goto LABEL_68;
+              }
+              else
+              {
+                if ( odm_face->pFacePlane.dist + v41 + outz * odm_face->pFacePlane.vNormal.z + pOut.x * odm_face->pFacePlane.vNormal.x > 0 )
+                  goto LABEL_68;
+              }
+              v_4a = abs(-(odm_face->pFacePlane.dist + v41 + outz * odm_face->pFacePlane.vNormal.z + pOut.x * odm_face->pFacePlane.vNormal.x)) >> 14;
+              if ( v_4a <= abs(v40) )
+              {
+                //LODWORD(v43) = v42 << 16;
+                //HIDWORD(v43) = v42 >> 16;
+                //vb = v43 / va;
+                vb = fixpoint_div(v42, va);
+                if ( vb >= 0 )
+                {
+                  if ( sub_4077F1(pOut.x + ((signed int)(fixpoint_mul(vb, v126) + 32768) >> 16),
+                                  pOut.y + ((signed int)(fixpoint_mul(vb, v122) + 32768) >> 16),
+                                    outz + ((signed int)(fixpoint_mul(vb, v118) + 32768) >> 16),
+                                  odm_face,
+                                  (BSPVertexBuffer *)a5a) )
+                  {
+                    v113 = 1;
+                    goto LABEL_71;
+                  }
+                }
+              }
+LABEL_68:
+			  ;
+              //++sDeptha;
+              //v_8 += 308;
+              //if ( sDeptha >= *((int *)a5a + 2) )
+                //goto LABEL_71;
+            }
+		  }
+        }
+LABEL_71:
+        ++v105;
+        v37 = outy;
+        v36 = pOut.x;
       }
-LABEL_71:
-      ++v161;
-      ++v105;
-      if ( v161 >= (signed int)pOutdoor->uNumBModels )
-        return !v114 || !v113;
-      v37 = outy;
-      v36 = pOut.x;
     }
-    v_8 = 0;
-    while ( 1 )
-    {
-      v39 = (ODMFace *)(v_8 + *((int *)a5a + 4));
-      if ( v150 > v39->pBoundingBox.x2
-        || v146 < v39->pBoundingBox.x1
-        || v142 > v39->pBoundingBox.y2
-        || v138 < v39->pBoundingBox.y1
-        || v134 > v39->pBoundingBox.z2
-        || v130 < v39->pBoundingBox.z1
-        || (ya = fixpoint_mul(v126, v39->pFacePlane.vNormal.x),
-            ve = fixpoint_mul(v122, v39->pFacePlane.vNormal.y),
-            v_4 = fixpoint_mul(v118, v39->pFacePlane.vNormal.z),
-            v20 = ya + ve + v_4 == 0,
-            v40 = ya + ve + v_4,
-            va = ya + ve + v_4,
-            v20) )
-        goto LABEL_68;
-      v41 = pOut.y * v39->pFacePlane.vNormal.y;
-      v42 = -(v39->pFacePlane.dist + v41 + outz * v39->pFacePlane.vNormal.z + pOut.x * v39->pFacePlane.vNormal.x);
-      if ( v40 <= 0 )
-      {
-        if ( v39->pFacePlane.dist + v41 + outz * v39->pFacePlane.vNormal.z + pOut.x * v39->pFacePlane.vNormal.x < 0 )
-          goto LABEL_68;
-      }
-      else
-      {
-        if ( v39->pFacePlane.dist + v41 + outz * v39->pFacePlane.vNormal.z + pOut.x * v39->pFacePlane.vNormal.x > 0 )
-          goto LABEL_68;
-      }
-      v_4a = abs(-(v39->pFacePlane.dist + v41 + outz * v39->pFacePlane.vNormal.z + pOut.x * v39->pFacePlane.vNormal.x)) >> 14;
-      if ( v_4a <= abs(v40) )
-      {
-        //LODWORD(v43) = v42 << 16;
-        //HIDWORD(v43) = v42 >> 16;
-        //vb = v43 / va;
-        vb = fixpoint_div(v42, va);
-        if ( vb >= 0 )
-        {
-          if ( sub_4077F1(
-                 pOut.x + ((signed int)(fixpoint_mul(vb, v126) + 32768) >> 16),
-                 pOut.y + ((signed int)(fixpoint_mul(vb, v122) + 32768) >> 16),
-                 outz + ((signed int)(fixpoint_mul(vb, v118) + 32768) >> 16),
-                 v39,
-                 (BSPVertexBuffer *)a5a) )
-          {
-            v113 = 1;
-            goto LABEL_71;
-          }
-        }
-      }
-LABEL_68:
-      ++sDeptha;
-      v_8 += 308;
-      if ( sDeptha >= *((int *)a5a + 2) )
-        goto LABEL_71;
-    }
+
   }
   return !v114 || !v113;
 }
--- a/mm7_3.cpp	Tue Feb 04 17:29:04 2014 +0600
+++ b/mm7_3.cpp	Wed Feb 05 00:59:33 2014 +0600
@@ -1594,7 +1594,7 @@
   float v39; // [sp+D0h] [bp-8h]@6
   int *v40; // [sp+D4h] [bp-4h]@2
 
-  __debugbreak();//нужно почистить, срабатывает при применении закла Точечный взрыв и при стрельбе из жезла
+//  __debugbreak();//нужно почистить, срабатывает при применении закла Точечный взрыв и при стрельбе из жезла
   v2 = (char *)&this->field_64[4 * this->uNumVertices];
   v38 = 0;
   *(int *)v2 = this->field_64[0];
@@ -2012,7 +2012,7 @@
   signed int v9; // [sp+Ch] [bp-8h]@1
   float v10; // [sp+10h] [bp-4h]@2
 
-  __debugbreak();// почистить
+  //__debugbreak();// почистить
   v1 = 0;
   v9 = 0;
   if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
@@ -2067,7 +2067,7 @@
   int a6; // [sp+3Ch] [bp-8h]@5
   int a5; // [sp+40h] [bp-4h]@5
 
-  __debugbreak(); //необходимо проверить this->field_B4[i*4+16]
+//  __debugbreak(); //необходимо проверить this->field_B4[i*4+16]
   v16 = 0;
   if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
   {