changeset 1911:af38275939cc

which_player_to_attack rename and cleaning
author Ritor1
date Tue, 22 Oct 2013 15:52:01 +0600
parents 18dacb49efe9
children 3f0b9ffd788c
files Actor.cpp Actor.h Player.cpp Render.cpp mm7_3.cpp mm7_5.cpp mm7_6.cpp
diffstat 7 files changed, 260 insertions(+), 344 deletions(-) [+]
line wrap: on
line diff
--- a/Actor.cpp	Tue Oct 22 00:04:14 2013 -0700
+++ b/Actor.cpp	Tue Oct 22 15:52:01 2013 +0600
@@ -4140,4 +4140,107 @@
     while ( v13 );
     ++uNumActors;
   }
-}
\ No newline at end of file
+}
+//----- (00426E10) --------------------------------------------------------
+int stru319::which_player_to_attack(Actor *pActor)
+{
+  signed int v2; // ebx@1
+  bool flag; // edi@37
+  int v22; // [sp+8h] [bp-140h]@3
+  int Victims_list[60]; // [sp+48h] [bp-100h]@48
+  int for_sex; // [sp+13Ch] [bp-Ch]@1
+  int for_race; // [sp+140h] [bp-8h]@1
+  int for_class; // [sp+144h] [bp-4h]@1
+
+  for_class = -1;
+  for_race = -1;
+  for_sex = -1;
+  v2 = 0;
+  if ( pActor->pMonsterInfo.uAttackPreference )
+  {
+    for ( uint i = 0; i < 16; i++ )
+    {
+      v22 = pActor->pMonsterInfo.uAttackPreference & (1 << i);
+      if ( v22 )
+      {
+        switch ( v22 )
+        {
+          case 1:
+            for_class = 0;
+            break;
+          case 2:
+            for_class = 12;
+            break;
+          case 4:
+            for_class = 16;
+            break;
+          case 8:
+            for_class = 28;
+            break;
+          case 16:
+            for_class = 24;
+            break;
+          case 32:
+            for_class = 32;
+            break;
+          case 64:
+            for_class = 20;
+            break;
+          case 128:
+            for_class = 4;
+            break;
+          case 256:
+            for_class = 8;
+            break;
+          case 512:
+            for_sex = 0;
+            break;
+          case 1024:
+            for_sex = 1;
+            break;
+          case 2048:
+            for_race = 0;
+            break;
+          case 4096:
+            for_race = 1;
+            break;
+          case 8192:
+            for_race = 3;
+            break;
+          case 16384:
+            for_race = 2;
+            break;
+        }
+        v2 = 0;
+        for ( uint j = 0; j < 4; ++j )
+        {
+          flag = 0;
+          if ( for_class != -1 && for_class == pPlayers[j + 1]->classType )
+            flag = true;
+          if ( for_sex != -1 && for_sex == pPlayers[j + 1]->uSex )
+            flag = true;
+          if ( for_race != -1 && for_race == pPlayers[j + 1]->GetRace() )
+            flag = true;
+          if ( flag == true )
+          {
+            if ( !(pPlayers[j + 1]->pConditions[12] | pPlayers[j + 1]->pConditions[13]
+                 | pPlayers[j + 1]->pConditions[14] | pPlayers[j + 1]->pConditions[15] | pPlayers[j + 1]->pConditions[16]) )
+              Victims_list[v2++] = j;
+          }
+        }
+      }
+    }
+    if ( v2 )
+      return Victims_list[rand() % v2];
+  }
+  for ( uint i = 0; i < 4; ++i )
+  {
+    if ( !(pPlayers[i + 1]->pConditions[12] | pPlayers[i + 1]->pConditions[13]
+         | pPlayers[i + 1]->pConditions[14] | pPlayers[i + 1]->pConditions[15] | pPlayers[i + 1]->pConditions[16]) )
+      Victims_list[v2++] = i;
+  }
+  if ( v2 )
+    return Victims_list[rand() % v2];
+  else
+    return 0;
+}
--- a/Actor.h	Tue Oct 22 00:04:14 2013 -0700
+++ b/Actor.h	Tue Oct 22 15:52:01 2013 +0600
@@ -13,7 +13,7 @@
 struct stru319
 {
   void LootActor(struct Actor *pActor);
-  int which_player_would_attack(struct Actor *pActor);
+  int which_player_to_attack(struct Actor *pActor);
   int  special_ability_use_check(struct Actor *pActor, int a2);
   int _427102(struct Actor *pActor, signed int a2);
   int PlayerHitOrMiss(struct Player *pPlayer, struct Actor *pActor, int a3, int a4);
--- a/Player.cpp	Tue Oct 22 00:04:14 2013 -0700
+++ b/Player.cpp	Tue Oct 22 15:52:01 2013 +0600
@@ -7435,7 +7435,7 @@
     {
       Actor *actorPtr = &pActors[uActorID];
       if ( a4 == -1 )
-        a4 = stru_50C198.which_player_would_attack(actorPtr);
+        a4 = stru_50C198.which_player_to_attack(actorPtr);
       Player *playerPtr = &pParty->pPlayers[a4];
       int dmgToReceive = actorPtr->_43B3E0_CalcDamage(dmgSource);
       unsigned __int16 spriteType = v37->uType;
--- a/Render.cpp	Tue Oct 22 00:04:14 2013 -0700
+++ b/Render.cpp	Tue Oct 22 15:52:01 2013 +0600
@@ -9044,4 +9044,157 @@
     }
   }
   return;
+}
+//----- (00479543) --------------------------------------------------------
+void Render::DrawSkyD3D()
+{
+  int v9; // eax@4
+  int v10; // ebx@4
+  int v13; // edi@6
+  int v14; // ecx@6
+  int v15; // eax@8
+  int v16; // eax@12
+  signed __int64 v17; // qtt@13
+  signed int v18; // ecx@13
+  struct Polygon pSkyPolygon; // [sp+14h] [bp-150h]@1
+  double v26; // [sp+120h] [bp-44h]@4
+  int v30; // [sp+134h] [bp-30h]@1
+  int v32; // [sp+13Ch] [bp-28h]@6
+  int v33; // [sp+140h] [bp-24h]@2
+  signed __int64 v34; // [sp+144h] [bp-20h]@1
+  int v35; // [sp+148h] [bp-1Ch]@4
+  int v36; // [sp+14Ch] [bp-18h]@2
+  int v37; // [sp+154h] [bp-10h]@8
+  int v38; // [sp+158h] [bp-Ch]@1
+  int v39; // [sp+15Ch] [bp-8h]@4
+  int v40; // [sp+160h] [bp-4h]@7
+
+  v30 = (signed __int64)((double)(pODMRenderParams->int_fov_rad * pGame->pIndoorCameraD3D->vPartyPos.z)
+                       / ((double)pODMRenderParams->int_fov_rad + 8192.0)
+                       + (double)(pViewport->uScreenCenterY + 7));//include "+ 7"
+  v34 = cos((double)pGame->pIndoorCameraD3D->sRotationX * 0.0030664064) * 0x2000;//(double)pODMRenderParams->shading_dist_mist
+  v38 = (signed __int64)((double)(pViewport->uScreenCenterY + 7)
+                       - (double)pODMRenderParams->int_fov_rad
+                       / (v34 + 0.0000001)
+                       * (sin((double)pGame->pIndoorCameraD3D->sRotationX * 0.0030664064)
+                        * (double)-0x2000//(double)pODMRenderParams->shading_dist_mist
+                        - (double)pGame->pIndoorCameraD3D->vPartyPos.z));
+  pSkyPolygon.Create_48607B(&stru_8019C8);//заполняется ptr_38
+  pSkyPolygon.ptr_38->_48694B_frustum_sky();
+  pSkyPolygon.uTileBitmapID = pOutdoor->uSky_TextureID;//179(original 166)
+  pSkyPolygon.pTexture = (Texture *)(SLOWORD(pOutdoor->uSky_TextureID) != -1 ? (int)&pBitmaps_LOD->pTextures[SLOWORD(pOutdoor->uSky_TextureID)] : 0);
+  if ( pSkyPolygon.pTexture )
+  {
+    pSkyPolygon.dimming_level = 0;
+    pSkyPolygon.uNumVertices = 4;
+  //centering(центруем)--наклон камеры ----------------------------------------
+    pSkyPolygon.v_18.x = -stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationX + 16);
+    pSkyPolygon.v_18.y = 0;
+    pSkyPolygon.v_18.z = -stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationX + 16);
+  
+  //sky wiew position(положение неба на экране)------------------------------------------
+  //                X
+  // 0._____________________________.3
+  //  |8,8                    468,8 |
+  //  |                             |
+  //  |                             |
+  // Y|                             |
+  //  |                             |
+  //  |8,351                468,351 |
+  // 1._____________________________.2
+  // 
+    array_50AC10[0].vWorldViewProjX = (double)(signed int)pViewport->uViewportTL_X;
+    array_50AC10[0].vWorldViewProjY = (double)(signed int)pViewport->uViewportTL_Y;
+
+    array_50AC10[1].vWorldViewProjX = (double)(signed int)pViewport->uViewportTL_X;
+    array_50AC10[1].vWorldViewProjY = (double)v38;
+
+    array_50AC10[2].vWorldViewProjX = (double)(signed int)pViewport->uViewportBR_X;
+    array_50AC10[2].vWorldViewProjY = (double)v38;
+
+    array_50AC10[3].vWorldViewProjX = (double)(signed int)pViewport->uViewportBR_X;
+    array_50AC10[3].vWorldViewProjY = (double)(signed int)pViewport->uViewportTL_Y;
+
+    pSkyPolygon.sTextureDeltaU = 224 * pMiscTimer->uTotalGameTimeElapsed;
+    pSkyPolygon.sTextureDeltaV = 224 * pMiscTimer->uTotalGameTimeElapsed;
+
+    pSkyPolygon.field_24 = 0x2000000u;
+    v33 = 65536 / (signed int)(signed __int64)(((double)(pViewport->uViewportBR_X - pViewport->uViewportTL_X) * 0.5) / tan(0.6457717418670654) + 0.5);
+    for ( uint i = 0; i < pSkyPolygon.uNumVertices; ++i )
+    {
+      v26 = array_50AC10[i].vWorldViewProjY + 6.7553994e15;
+      //rotate skydome(вращение купола неба)--------------------------------------
+      // В игре принята своя система измерения углов. Полный угол (180). Значению угла 0 соответствует 
+      // направление на север и/или юг (либо на восток и/или запад), значению 65536 еденицам(0х10000) соответствует угол 90.
+	  // две переменные хранят данные по углу обзора. field_14 по западу и востоку. field_20 по югу и северу
+      // от -25080 до 25080
+      v39 = (unsigned __int64)(pSkyPolygon.ptr_38->viewing_angle_from_west_east * (signed __int64)(v33 * (v30 - array_50AC10[i].vWorldViewProjY))) >> 16;
+      v35 = v39 + pSkyPolygon.ptr_38->angle_from_north;
+
+      v39 = (unsigned __int64)(pSkyPolygon.ptr_38->viewing_angle_from_north_south * (signed __int64)(v33 * (v30 - array_50AC10[i].vWorldViewProjY))) >> 16;
+      v36 = v39 + pSkyPolygon.ptr_38->angle_from_east;
+
+      v38 = pSkyPolygon.v_18.z;
+      v9 = (unsigned __int64)(pSkyPolygon.v_18.z * (signed __int64)(v33 * (v30 - array_50AC10[i].vWorldViewProjY))) >> 16;
+      v10 = pSkyPolygon.v_18.x + v9;
+      v39 = pSkyPolygon.v_18.x + v9;
+      if ( pSkyPolygon.v_18.x + v9 > 0 )
+      {
+        v10 = 0;
+        v39 = 0;
+      }
+      v38 = v10;
+      v13 = v33 * (pViewport->uScreenCenterX - (signed __int64)array_50AC10[i].vWorldViewProjX);
+      v34 = -pSkyPolygon.field_24;
+      v32 = (signed __int64)array_50AC10[i].vWorldViewProjX;
+      v14 = v33 * (v30 - (signed __int64)array_50AC10[i].vWorldViewProjX);
+      while ( 1 )
+      {
+        v40 = v14;
+        if ( !v10 )
+          goto LABEL_12;
+        v37 = abs((int)v34 >> 14);
+        v15 = abs(v10);
+        if ( v37 <= v15 || v32 <= (signed int)pViewport->uViewportTL_Y )
+        {
+          if ( v39 <= 0 )
+            break;
+        }
+        v14 = v40;
+LABEL_12:
+        v37 = pSkyPolygon.v_18.z;
+        v16 = (unsigned __int64)(pSkyPolygon.v_18.z * (signed __int64)v14) >> 16;
+        --v32;
+        v14 += v33;
+        v10 = pSkyPolygon.v_18.x + v16;
+        v39 = pSkyPolygon.v_18.x + v16;
+        v38 = pSkyPolygon.v_18.x + v16;
+      }
+      LODWORD(v17) = LODWORD(v34) << 16;
+      HIDWORD(v17) = v34 >> 16;
+      //v40 = v17 / v38;
+      v18 = v17 / v38;
+      if ( v18 < 0 )
+        v18 = pODMRenderParams->shading_dist_mist;
+      v37 = v35 + ((unsigned __int64)(pSkyPolygon.ptr_38->angle_from_west * (signed __int64)v13) >> 16);
+      v35 = 224 * pMiscTimer->uTotalGameTimeElapsed
+          + ((signed int)((unsigned __int64)(v37 * (signed __int64)v18) >> 16) >> 3);
+      array_50AC10[i].u = (double)v35 / ((double)pSkyPolygon.pTexture->uTextureWidth * 65536.0);
+
+      v36 = v36 + ((unsigned __int64)(pSkyPolygon.ptr_38->angle_from_south * (signed __int64)v13) >> 16);
+      v35 = 224 * pMiscTimer->uTotalGameTimeElapsed
+         + ((signed int)((unsigned __int64)(v36 * (signed __int64)v18) >> 16) >> 3);
+      array_50AC10[i].v = (double)v35 / ((double)pSkyPolygon.pTexture->uTextureHeight * 65536.0);
+
+      array_50AC10[i].vWorldViewPosition.x = (double)0x2000;//pODMRenderParams->shading_dist_mist
+      array_50AC10[i]._rhw = 1.0 / (double)(v18 >> 16);
+    }
+    pRenderer->DrawSkyPolygon(pSkyPolygon.uNumVertices, &pSkyPolygon, pBitmaps_LOD->pHardwareTextures[(signed __int16)pSkyPolygon.uTileBitmapID]);
+    array_50AC10[0].vWorldViewProjY = (double)v38;
+    array_50AC10[1].vWorldViewProjY = array_50AC10[1].vWorldViewProjY + 30.0;
+    array_50AC10[2].vWorldViewProjY = array_50AC10[2].vWorldViewProjY + 30.0;
+    array_50AC10[3].vWorldViewProjY = (double)v38;
+    pRenderer->DrawSkyPolygon(pSkyPolygon.uNumVertices, &pSkyPolygon, pBitmaps_LOD->pHardwareTextures[(signed __int16)pSkyPolygon.uTileBitmapID]);
+    return;
+  }
 }
\ No newline at end of file
--- a/mm7_3.cpp	Tue Oct 22 00:04:14 2013 -0700
+++ b/mm7_3.cpp	Tue Oct 22 15:52:01 2013 +0600
@@ -4876,161 +4876,6 @@
   ErrD3D((skybox_surface)->Unlock(0));
   goto draw;
 }
-
-//----- (00479543) --------------------------------------------------------
-void Render::DrawSkyD3D()
-{
-  int v9; // eax@4
-  int v10; // ebx@4
-  int v13; // edi@6
-  int v14; // ecx@6
-  int v15; // eax@8
-  int v16; // eax@12
-  signed __int64 v17; // qtt@13
-  signed int v18; // ecx@13
-  struct Polygon pSkyPolygon; // [sp+14h] [bp-150h]@1
-  double v26; // [sp+120h] [bp-44h]@4
-  int v30; // [sp+134h] [bp-30h]@1
-  int v32; // [sp+13Ch] [bp-28h]@6
-  int v33; // [sp+140h] [bp-24h]@2
-  signed __int64 v34; // [sp+144h] [bp-20h]@1
-  int v35; // [sp+148h] [bp-1Ch]@4
-  int v36; // [sp+14Ch] [bp-18h]@2
-  int v37; // [sp+154h] [bp-10h]@8
-  int v38; // [sp+158h] [bp-Ch]@1
-  int v39; // [sp+15Ch] [bp-8h]@4
-  int v40; // [sp+160h] [bp-4h]@7
-
-  v30 = (signed __int64)((double)(pODMRenderParams->int_fov_rad * pGame->pIndoorCameraD3D->vPartyPos.z)
-                       / ((double)pODMRenderParams->int_fov_rad + 8192.0)
-                       + (double)(pViewport->uScreenCenterY + 7));//include "+ 7"
-  v34 = cos((double)pGame->pIndoorCameraD3D->sRotationX * 0.0030664064) * 0x2000;//(double)pODMRenderParams->shading_dist_mist
-  v38 = (signed __int64)((double)(pViewport->uScreenCenterY + 7)
-                       - (double)pODMRenderParams->int_fov_rad
-                       / (v34 + 0.0000001)
-                       * (sin((double)pGame->pIndoorCameraD3D->sRotationX * 0.0030664064)
-                        * (double)-0x2000//(double)pODMRenderParams->shading_dist_mist
-                        - (double)pGame->pIndoorCameraD3D->vPartyPos.z));
-  pSkyPolygon.Create_48607B(&stru_8019C8);//заполняется ptr_38
-  pSkyPolygon.ptr_38->_48694B_frustum_sky();
-  pSkyPolygon.uTileBitmapID = pOutdoor->uSky_TextureID;//179(original 166)
-  pSkyPolygon.pTexture = (Texture *)(SLOWORD(pOutdoor->uSky_TextureID) != -1 ? (int)&pBitmaps_LOD->pTextures[SLOWORD(pOutdoor->uSky_TextureID)] : 0);
-  if ( pSkyPolygon.pTexture )
-  {
-    pSkyPolygon.dimming_level = 0;
-    pSkyPolygon.uNumVertices = 4;
-  //centering(центруем)--наклон камеры ----------------------------------------
-    pSkyPolygon.v_18.x = -stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationX + 16);
-    pSkyPolygon.v_18.y = 0;
-    pSkyPolygon.v_18.z = -stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationX + 16);
-  
-  //sky wiew position(положение неба на экране)------------------------------------------
-  //                X
-  // 0._____________________________.3
-  //  |8,8                    468,8 |
-  //  |                             |
-  //  |                             |
-  // Y|                             |
-  //  |                             |
-  //  |8,351                468,351 |
-  // 1._____________________________.2
-  // 
-    array_50AC10[0].vWorldViewProjX = (double)(signed int)pViewport->uViewportTL_X;
-    array_50AC10[0].vWorldViewProjY = (double)(signed int)pViewport->uViewportTL_Y;
-
-    array_50AC10[1].vWorldViewProjX = (double)(signed int)pViewport->uViewportTL_X;
-    array_50AC10[1].vWorldViewProjY = (double)v38;
-
-    array_50AC10[2].vWorldViewProjX = (double)(signed int)pViewport->uViewportBR_X;
-    array_50AC10[2].vWorldViewProjY = (double)v38;
-
-    array_50AC10[3].vWorldViewProjX = (double)(signed int)pViewport->uViewportBR_X;
-    array_50AC10[3].vWorldViewProjY = (double)(signed int)pViewport->uViewportTL_Y;
-
-    pSkyPolygon.sTextureDeltaU = 224 * pMiscTimer->uTotalGameTimeElapsed;
-    pSkyPolygon.sTextureDeltaV = 224 * pMiscTimer->uTotalGameTimeElapsed;
-
-    pSkyPolygon.field_24 = 0x2000000u;
-    v33 = 65536 / (signed int)(signed __int64)(((double)(pViewport->uViewportBR_X - pViewport->uViewportTL_X) * 0.5) / tan(0.6457717418670654) + 0.5);
-    for ( uint i = 0; i < pSkyPolygon.uNumVertices; ++i )
-    {
-      v26 = array_50AC10[i].vWorldViewProjY + 6.7553994e15;
-      //rotate skydome(вращение купола неба)--------------------------------------
-      // В игре принята своя система измерения углов. Полный угол (180). Значению угла 0 соответствует 
-      // направление на север и/или юг (либо на восток и/или запад), значению 65536 еденицам(0х10000) соответствует угол 90.
-	  // две переменные хранят данные по углу обзора. field_14 по западу и востоку. field_20 по югу и северу
-      // от -25080 до 25080
-      v39 = (unsigned __int64)(pSkyPolygon.ptr_38->viewing_angle_from_west_east * (signed __int64)(v33 * (v30 - array_50AC10[i].vWorldViewProjY))) >> 16;
-      v35 = v39 + pSkyPolygon.ptr_38->angle_from_north;
-
-      v39 = (unsigned __int64)(pSkyPolygon.ptr_38->viewing_angle_from_north_south * (signed __int64)(v33 * (v30 - array_50AC10[i].vWorldViewProjY))) >> 16;
-      v36 = v39 + pSkyPolygon.ptr_38->angle_from_east;
-
-      v38 = pSkyPolygon.v_18.z;
-      v9 = (unsigned __int64)(pSkyPolygon.v_18.z * (signed __int64)(v33 * (v30 - array_50AC10[i].vWorldViewProjY))) >> 16;
-      v10 = pSkyPolygon.v_18.x + v9;
-      v39 = pSkyPolygon.v_18.x + v9;
-      if ( pSkyPolygon.v_18.x + v9 > 0 )
-      {
-        v10 = 0;
-        v39 = 0;
-      }
-      v38 = v10;
-      v13 = v33 * (pViewport->uScreenCenterX - (signed __int64)array_50AC10[i].vWorldViewProjX);
-      v34 = -pSkyPolygon.field_24;
-      v32 = (signed __int64)array_50AC10[i].vWorldViewProjX;
-      v14 = v33 * (v30 - (signed __int64)array_50AC10[i].vWorldViewProjX);
-      while ( 1 )
-      {
-        v40 = v14;
-        if ( !v10 )
-          goto LABEL_12;
-        v37 = abs((int)v34 >> 14);
-        v15 = abs(v10);
-        if ( v37 <= v15 || v32 <= (signed int)pViewport->uViewportTL_Y )
-        {
-          if ( v39 <= 0 )
-            break;
-        }
-        v14 = v40;
-LABEL_12:
-        v37 = pSkyPolygon.v_18.z;
-        v16 = (unsigned __int64)(pSkyPolygon.v_18.z * (signed __int64)v14) >> 16;
-        --v32;
-        v14 += v33;
-        v10 = pSkyPolygon.v_18.x + v16;
-        v39 = pSkyPolygon.v_18.x + v16;
-        v38 = pSkyPolygon.v_18.x + v16;
-      }
-      LODWORD(v17) = LODWORD(v34) << 16;
-      HIDWORD(v17) = v34 >> 16;
-      //v40 = v17 / v38;
-      v18 = v17 / v38;
-      if ( v18 < 0 )
-        v18 = pODMRenderParams->shading_dist_mist;
-      v37 = v35 + ((unsigned __int64)(pSkyPolygon.ptr_38->angle_from_west * (signed __int64)v13) >> 16);
-      v35 = 224 * pMiscTimer->uTotalGameTimeElapsed
-          + ((signed int)((unsigned __int64)(v37 * (signed __int64)v18) >> 16) >> 3);
-      array_50AC10[i].u = (double)v35 / ((double)pSkyPolygon.pTexture->uTextureWidth * 65536.0);
-
-      v36 = v36 + ((unsigned __int64)(pSkyPolygon.ptr_38->angle_from_south * (signed __int64)v13) >> 16);
-      v35 = 224 * pMiscTimer->uTotalGameTimeElapsed
-         + ((signed int)((unsigned __int64)(v36 * (signed __int64)v18) >> 16) >> 3);
-      array_50AC10[i].v = (double)v35 / ((double)pSkyPolygon.pTexture->uTextureHeight * 65536.0);
-
-      array_50AC10[i].vWorldViewPosition.x = (double)0x2000;//pODMRenderParams->shading_dist_mist
-      array_50AC10[i]._rhw = 1.0 / (double)(v18 >> 16);
-    }
-    pRenderer->DrawSkyPolygon(pSkyPolygon.uNumVertices, &pSkyPolygon, pBitmaps_LOD->pHardwareTextures[(signed __int16)pSkyPolygon.uTileBitmapID]);
-    array_50AC10[0].vWorldViewProjY = (double)v38;
-    array_50AC10[1].vWorldViewProjY = array_50AC10[1].vWorldViewProjY + 30.0;
-    array_50AC10[2].vWorldViewProjY = array_50AC10[2].vWorldViewProjY + 30.0;
-    array_50AC10[3].vWorldViewProjY = (double)v38;
-    pRenderer->DrawSkyPolygon(pSkyPolygon.uNumVertices, &pSkyPolygon, pBitmaps_LOD->pHardwareTextures[(signed __int16)pSkyPolygon.uTileBitmapID]);
-    return;
-  }
-}
-
 //----- (0047A384) --------------------------------------------------------
 void ODM_LoadAndInitialize(const char *pLevelFilename, ODMRenderParams *thisa)
 {
--- a/mm7_5.cpp	Tue Oct 22 00:04:14 2013 -0700
+++ b/mm7_5.cpp	Tue Oct 22 15:52:01 2013 +0600
@@ -3690,7 +3690,7 @@
               v11.x = *((short *)v1 - 200);
               if ( sub_407A1C(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + pParty->sEyelevel, v11) )
               {
-                v12 = stru_50C198.which_player_would_attack(&pActors[v39]);
+                v12 = stru_50C198.which_player_to_attack(&pActors[v39]);
                 DamagePlayerFromMonster(*((short *)v1 - 300), stru_50FE08.field_450[v43], pVelocity, v12);
               }
             }
--- a/mm7_6.cpp	Tue Oct 22 00:04:14 2013 -0700
+++ b/mm7_6.cpp	Tue Oct 22 15:52:01 2013 +0600
@@ -203,191 +203,6 @@
     pActor->Remove();
   }
 }
-
-//----- (00426E10) --------------------------------------------------------
-int stru319::which_player_would_attack(Actor *pActor)
-{
-  signed int v2; // ebx@1
-  int v3; // ecx@2
-  signed int v4; // edx@3
-  char v5; // zf@3
-  unsigned int v6; // eax@3
-  int v7; // eax@6
-  int v8; // eax@7
-  int v9; // eax@8
-  int v10; // eax@9
-  int v11; // eax@10
-  int v12; // eax@11
-  int v13; // esi@35
-  signed int v14; // edi@37
-  enum CHARACTER_RACE v15; // eax@44
-  Player *v16; // ecx@47
-  unsigned __int8 v17; // sf@50
-  unsigned __int8 v18; // of@50
-  int v19; // esi@52
-  Player *v20; // ecx@53
-  int result; // eax@57
-  int v22[16]; // [sp+8h] [bp-140h]@3
-  int v23[60]; // [sp+48h] [bp-100h]@48
-  int v24; // [sp+138h] [bp-10h]@2
-  int v25; // [sp+13Ch] [bp-Ch]@1
-  int v26; // [sp+140h] [bp-8h]@1
-  int v27; // [sp+144h] [bp-4h]@1
-
-  v27 = -1;
-  v26 = -1;
-  v25 = -1;
-  v2 = 0;
-  if ( pActor->pMonsterInfo.uAttackPreference )
-  {
-    v3 = 0;
-    v24 = 0;
-    do
-    {
-      v4 = 1;
-      v6 = pActor->pMonsterInfo.uAttackPreference & (1 << v3);
-      v5 = (pActor->pMonsterInfo.uAttackPreference & (1 << v3)) == 0;
-      v22[v3] = v6;
-      if ( !v5 )
-      {
-        if ( (signed int)v6 > 128 )
-        {
-          switch ( v6 )
-          {
-            case 0x100u:
-              v27 = 8;
-              break;
-            case 0x200u:
-              v25 = 0;
-              break;
-            case 0x400u:
-              v25 = 1;
-              break;
-            case 0x800u:
-              v26 = 0;
-              break;
-            case 0x1000u:
-              v26 = 1;
-              break;
-            case 0x2000u:
-              v26 = 3;
-              break;
-            case 0x4000u:
-              v26 = 2;
-              break;
-          }
-        }
-        else
-        {
-          if ( v6 == 128 )
-          {
-            v27 = 4;
-          }
-          else
-          {
-            v7 = v6 - 1;
-            if ( v7 )
-            {
-              v8 = v7 - 1;
-              if ( v8 )
-              {
-                v9 = v8 - 2;
-                if ( v9 )
-                {
-                  v10 = v9 - 4;
-                  if ( v10 )
-                  {
-                    v11 = v10 - 8;
-                    if ( v11 )
-                    {
-                      v12 = v11 - 16;
-                      if ( v12 )
-                      {
-                        if ( v12 == 32 )
-                          v27 = 20;
-                      }
-                      else
-                      {
-                        v27 = 32;
-                      }
-                    }
-                    else
-                    {
-                      v27 = 24;
-                    }
-                  }
-                  else
-                  {
-                    v27 = 28;
-                  }
-                }
-                else
-                {
-                  v27 = 16;
-                }
-              }
-              else
-              {
-                v27 = 12;
-              }
-            }
-            else
-            {
-              v27 = 0;
-            }
-          }
-        }
-        v2 = 0;
-        v13 = 0;
-        while ( 1 )
-        {
-          v14 = 0;
-          if ( v27 != -1 && v27 == pPlayers[v13 + 1]->classType )
-            v14 = v4;
-          if ( v25 != -1 && v25 == pPlayers[v13 + 1]->uSex )
-            v14 = v4;
-          if ( v26 != -1 )
-          {
-            v15 = pPlayers[v13 + 1]->GetRace();
-            if ( v26 == v15 )
-              v14 = 1;
-          }
-          if ( v14 == 1 )
-          {
-            v16 = pPlayers[v13 + 1];
-            if ( !(v16->pConditions[12] | v16->pConditions[13] | v16->pConditions[14] | v16->pConditions[15] | v16->pConditions[16]) )
-              v23[v2++] = v13;
-          }
-          ++v13;
-          if ( v13 >= 4 )
-            break;
-          v4 = 1;
-        }
-      }
-      v3 = v24 + 1;
-      v18 = __OFSUB__(v24 + 1, 15);
-      v17 = v24++ - 14 < 0;
-    }
-    while ( v17 ^ v18 );
-    if ( v2 )
-      return v23[rand() % v2];
-  }
-  v19 = 0;
-  do
-  {
-    v20 = pPlayers[v19 + 1];
-    if ( !(v20->pConditions[12] | v20->pConditions[13] | v20->pConditions[14] | v20->pConditions[15] | v20->pConditions[16]) )
-      v23[v2++] = v19;
-    ++v19;
-  }
-  while ( v19 < 4 );
-  if ( v2 )
-    result = v23[rand() % v2];
-  else
-    result = 0;
-  return result;
-}
-
 //----- (0042704B) --------------------------------------------------------
 int stru319::special_ability_use_check( struct Actor *pActor, int a2 )
     {