changeset 2390:c631b1877204

area_of_effect_damage_evaluate - fixed spells radius problem
author zipi
date Thu, 03 Jul 2014 23:27:27 +0100
parents 6a7309a847ea
children 22cbc67a619e
files Indoor.cpp mm7_5.cpp
diffstat 2 files changed, 15 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/Indoor.cpp	Wed Jul 02 15:13:39 2014 +0200
+++ b/Indoor.cpp	Thu Jul 03 23:27:27 2014 +0100
@@ -4139,7 +4139,7 @@
                                 this->viewing_angle_from_north_south, this->field_8_party_dir_z);
 }
 //----- (00407A1C) --------------------------------------------------------
-bool __fastcall sub_407A1C(int x, int z, int y, Vec3_int_ v)
+bool __fastcall sub_407A1C(int x, int y, int z, Vec3_int_ v)
 {
   unsigned int v4; // esi@1
   int dist_y; // edi@2
@@ -4155,15 +4155,12 @@
   signed int v21; // ebx@25
   signed int v23; // edi@26
   int v24; // ST34_4@30
-  Vec3_int_ v27; // ST08_12@37
-  Vec3_int_ v28; // ST08_12@37
   signed int v32; // ecx@37
   int v33; // eax@37
   int v35; // eax@39
   ODMFace *odm_face; // esi@54
   signed int v40; // ebx@60
   signed int v42; // edi@61
-  Vec3_int_ v45; // ST08_12@73
   signed int v49; // ecx@73
   int v50; // eax@73
   int v51; // edx@75
@@ -4177,7 +4174,6 @@
   signed int v66; // ebx@98
   signed int v68; // edi@99
   int v69; // ST2C_4@103
-  Vec3_int_ v72; // ST08_12@111
   signed int v77; // ecx@111
   int v78; // eax@111
   int v79; // edx@113
@@ -4193,7 +4189,6 @@
   int v110; // [sp+18h] [bp-64h]@31
   signed int v113; // [sp+20h] [bp-5Ch]@1
   signed int v114; // [sp+24h] [bp-58h]@1
-  unsigned int a4_8; // [sp+30h] [bp-4Ch]@1
   int v119; // [sp+34h] [bp-48h]@75
   int v120; // [sp+34h] [bp-48h]@113
   int v121; // [sp+38h] [bp-44h]@4
@@ -4251,20 +4246,19 @@
 
   //__debugbreak();срабатывает при стрельбе огненным шаром
 
-  v4 = stru_5C6E00->Atan2(v.x - x, v.y - z);
+  v4 = stru_5C6E00->Atan2(v.x - x, v.y - y);
+
+  v113 = 0;
   v114 = 0;
-  v97.z = y;
+
+  v97.z = z;
   v97.x = x;
-  v97.y = z;
-  v113 = 0;
-  a4_8 = stru_5C6E00->Atan2(v.x - x, v.y - z);
+  v97.y = y;
+
   if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
   {
     Vec3_int_::Rotate(32, stru_5C6E00->uIntegerHalfPi + v4, 0, v97, &sX, &sY, &sZ);
-    v45.z = v.z;
-    v45.x = v.x;
-    v45.y = v.y;
-    Vec3_int_::Rotate(32, stru_5C6E00->uIntegerHalfPi + v4, 0, v45, &outx, &outy, &outz);
+    Vec3_int_::Rotate(32, stru_5C6E00->uIntegerHalfPi + v4, 0, v, &outx, &outy, &outz);
     dist_y = outy - sY;
     dist_z = outz - sZ;
 	dist_x = outx - sX;
@@ -4358,11 +4352,8 @@
       }
     }
     
-	v72.z = y;
-    v72.x = x;
-    v72.y = z;
-    Vec3_int_::Rotate(32, a4_8 - stru_5C6E00->uIntegerHalfPi, 0, v72, &sX, &sY, &sZ);
-    Vec3_int_::Rotate(32, a4_8 - stru_5C6E00->uIntegerHalfPi, 0, v, &outx, &outy, &outz);
+    Vec3_int_::Rotate(32, v4 - stru_5C6E00->uIntegerHalfPi, 0, v97, &sX, &sY, &sZ);
+    Vec3_int_::Rotate(32, v4 - stru_5C6E00->uIntegerHalfPi, 0, v, &outx, &outy, &outz);
 	dist_y = outy - sY;
 	dist_z = outz - sZ;
 	dist_x = outx - sX;
@@ -4411,7 +4402,6 @@
         || v136 > face->pBounding.z2 || v140 < face->pBounding.z1
         || v20 )
         continue;
-      //v92 = sZ * face->pFacePlane_old.vNormal.z;
       v93 = -(face->pFacePlane_old.dist + sX * face->pFacePlane_old.vNormal.x
                                         + sY * face->pFacePlane_old.vNormal.y
                                         + sZ * face->pFacePlane_old.vNormal.z);
@@ -4434,10 +4424,6 @@
                                              + sZ * face->pFacePlane_old.vNormal.z)) >> 14;
       if ( v_4c <= abs(v91) )
       {
-        //LODWORD(v94) = v93 << 16;
-        //HIDWORD(v94) = v93 >> 16;
-        //v95 = v94 / vc;
-        //vd = v94 / vc;
         vd = fixpoint_div(v93, vc);
         if ( vd >= 0 )
         {
@@ -4519,10 +4505,6 @@
                                                 + sZ * odm_face->pFacePlane.vNormal.z)) >> 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 )
             {
@@ -4541,14 +4523,8 @@
       }
     }
     
-	v27.z = y;
-    v27.x = x;
-    v27.y = z;
-    Vec3_int_::Rotate(32, a4_8 - stru_5C6E00->uIntegerHalfPi, 0, v27, &sX, &sY, &sZ);
-    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, &outz);
+    Vec3_int_::Rotate(32, v4 - stru_5C6E00->uIntegerHalfPi, 0, v97, &sX, &sY, &sZ);
+    Vec3_int_::Rotate(32, v4 - stru_5C6E00->uIntegerHalfPi, 0, v, &outx, &outy, &outz);
 	dist_y = outy - sY;
 	dist_z = outz - sZ;
 	dist_x = outx - sX;
--- a/mm7_5.cpp	Wed Jul 02 15:13:39 2014 +0200
+++ b/mm7_5.cpp	Thu Jul 03 23:27:27 2014 +0100
@@ -114,7 +114,7 @@
           v15 = pActors[target_id].vPosition.y - AttackerInfo.pYs[attacker_id];
           a1 = pActors[target_id].vPosition.x - AttackerInfo.pXs[attacker_id];
           v44 = pActors[target_id].vPosition.z;
-          v19 = AttackerInfo.pYs[attacker_id] + pActors[target_id].uActorRadius;
+          v19 = AttackerInfo.field_324[attacker_id] + pActors[target_id].uActorRadius;
           v48 = v15;
           if ( a1 * a1 + v15 * v15 + (pActors[target_id].vPosition.z + (pActors[target_id].uActorHeight >> 1) - AttackerInfo.pZs[attacker_id])
            * (pActors[target_id].vPosition.z + (pActors[target_id].uActorHeight >> 1) - AttackerInfo.pZs[attacker_id]) < (unsigned int)(v19 * v19) )
@@ -167,7 +167,7 @@
             v48 = pActors[actorID].vPosition.y - AttackerInfo.pYs[attacker_id];
             v44 = pActors[actorID].vPosition.z;
             v32 = (pActors[actorID].uActorHeight / 2) - AttackerInfo.pZs[attacker_id];
-            v33 = pActors[actorID].uActorRadius + AttackerInfo.pYs[attacker_id];
+            v33 = pActors[actorID].uActorRadius + AttackerInfo.field_324[attacker_id];
             if ( a1 * a1 + v48 * v48 + (v31 + v32) * (v31 + v32) < (unsigned int)(v33 * v33) )
             {
               attacker_coord.x = AttackerInfo.pXs[attacker_id];