changeset 2028:136b4d8d36f6

bool new_speed
author Ritor1
date Mon, 18 Nov 2013 10:07:17 +0600
parents beb97b20c3ed
children 81a0e6819d3f
files mm7_2.cpp mm7_3.cpp
diffstat 2 files changed, 40 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/mm7_2.cpp	Thu Nov 14 17:25:09 2013 +0600
+++ b/mm7_2.cpp	Mon Nov 18 10:07:17 2013 +0600
@@ -4301,6 +4301,7 @@
 bool debug_information = false;
 bool show_picked_face = false;
 bool draw_debug_line = false;
+bool new_speed = true;
 
 //----- (00462C94) --------------------------------------------------------
 bool MM_Main(const wchar_t *pCmdLine)
@@ -4350,7 +4351,7 @@
   uCPUSpeed = Rect.bottom;*/
   uCPUSpeed = 2048; // about 2GHz
 
-  constructors();
+  //constructors();
 
   if (!MM7_Initialize(640, 480))
   {
--- a/mm7_3.cpp	Thu Nov 14 17:25:09 2013 +0600
+++ b/mm7_3.cpp	Mon Nov 18 10:07:17 2013 +0600
@@ -2063,7 +2063,7 @@
   int v2; // ebx@1
   int v3; // eax@14
   int v6; // esi@45
-  ODMFace *v7; // ecx@45
+  ODMFace *face; // ecx@45
   signed int v33; // eax@143
   int v34; // esi@143
   int v35; // esi@147
@@ -2123,9 +2123,9 @@
   bool high_fall_flag; // [sp+1Ch] [bp-78h]@33
   int v102; // [sp+20h] [bp-74h]@1
   int v103; // [sp+24h] [bp-70h]@1
-  int bFeatherFall; // [sp+28h] [bp-6Ch]@4
+  bool bFeatherFall; // [sp+28h] [bp-6Ch]@4
   int v105; // [sp+2Ch] [bp-68h]@24
-  int bWaterWalk; // [sp+30h] [bp-64h]@1
+  bool bWaterWalk; // [sp+30h] [bp-64h]@1
   int v109; // [sp+3Ch] [bp-58h]@28
   int v110; // [sp+40h] [bp-54h]@180
   int v111; // [sp+44h] [bp-50h]@14
@@ -2145,7 +2145,6 @@
   int v128; // [sp+88h] [bp-Ch]@1
   int v129; // [sp+8Ch] [bp-8h]@92
 
-  pZ = pParty->vPosition.z;
   v1 = 0;
   v103 = 0;
   v2 = 0;
@@ -2154,6 +2153,7 @@
   v129 = 0;
   pX = pParty->vPosition.x;
   pY = pParty->vPosition.y;
+  pZ = pParty->vPosition.z;
   v113 = pParty->field_6F0;
   hovering = false;
   bool partyAtHighSlope = IsTerrainSlopeTooHigh(pParty->vPosition.x, pParty->vPosition.y);
@@ -2161,32 +2161,32 @@
   party_walking_flag = false;
   v102 = 0;
   pModel = 0;
-  bWaterWalk = 0;
-  if (!pParty->FeatherFallActive())
+  bWaterWalk = false;
+
+  if (!pParty->FeatherFallActive())//Проверка падение пера
   {
-    bFeatherFall = 0;
+    bFeatherFall = false;
     for (int i = 0; i < 4; ++i)
       if (pParty->pPlayers[i].WearsItemAnyWhere(ITEM_ARTIFACT_LADYS_ESCORT))  // seems like flying boots
       {
-        bFeatherFall = 1;
+        bFeatherFall = true;
         break;
       }
   }
   else
-  {
-	bFeatherFall = 1;
-  }
-//LABEL_9:
+    bFeatherFall = true;
+
   pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER;
-  if (pParty->WaterWalkActive())
+  if (pParty->WaterWalkActive())//Проверка хождения по воде
   {
     //LOBYTE(pParty->uFlags) &= 0x7Fu;
-    bWaterWalk = 1;
+    bWaterWalk = true;
     *(short *)&stru_5E4C90_MapPersistVars._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uOverlayID + 119] |= 1u;
     if (!(pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags & 1) &&
-		pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster - 1].sMana <= 0 )
-      bWaterWalk = 0;
+          pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster - 1].sMana <= 0 )
+      bWaterWalk = false;
   }
+
   int bmodel_standing_on_pid;
   int is_on_water = false;
   v3 = ODM_GetFloorLevel(pX, pY, pZ, pParty->uPartyHeight, &is_on_water, &bmodel_standing_on_pid, bWaterWalk);
@@ -2203,14 +2203,14 @@
     {
       pParty->uFlags &= ~PARTY_FLAGS_1_LANDING;
     }
-    else for (int _i = 0; _i < 4; ++_i)     // receive falling damage
+    else for (int i = 0; i < 4; ++i)     // receive falling damage
     {
-      if ( !pParty->pPlayers[_i].HasEnchantedItemEquipped(72) && !pParty->pPlayers[_i].WearsItem(ITEM_ARTIFACT_HERMES_SANDALS, EQUIP_BOOTS) )
+      if ( !pParty->pPlayers[i].HasEnchantedItemEquipped(72) && !pParty->pPlayers[i].WearsItem(ITEM_ARTIFACT_HERMES_SANDALS, EQUIP_BOOTS) )
       {
-        pParty->pPlayers[_i].ReceiveDamage(
-            (signed int)((pParty->uFallStartY - pZ) * (unsigned __int64)(pParty->pPlayers[_i].GetMaxHealth() / 10)) / 256, DMGT_PHISYCAL);
-        v105 = 20 - pParty->pPlayers[_i].GetParameterBonus(pParty->pPlayers[_i].GetActualEndurance());
-        pParty->pPlayers[_i].SetRecoveryTime((signed __int64)((double)v105 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
+        pParty->pPlayers[i].ReceiveDamage(
+            (signed int)((pParty->uFallStartY - pZ) * (unsigned __int64)(pParty->pPlayers[i].GetMaxHealth() / 10)) / 256, DMGT_PHISYCAL);
+        v105 = 20 - pParty->pPlayers[i].GetParameterBonus(pParty->pPlayers[i].GetActualEndurance());
+        pParty->pPlayers[i].SetRecoveryTime((signed __int64)((double)v105 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
       }
       //}
       //while ( (signed int)v4 <= (signed int)&pPlayers[4] );
@@ -2247,17 +2247,17 @@
       {
         if ( (bmodel_standing_on_pid >> 6) < pOutdoor->uNumBModels )
         {
-          v7 = pOutdoor->pBModels[bmodel_standing_on_pid >> 6].pFaces;
+          face = pOutdoor->pBModels[bmodel_standing_on_pid >> 6].pFaces;
           v6 = bmodel_standing_on_pid & 0x3F;
           /*if ( *(char *)(v7->pFacePlane.vNormal.x + 308 * v6 + 31) & 4 )
           {
             pParty->field_6F4_packedid = PID(OBJECT_BModel,v108);
             v103 = *(short *)(v7->pFacePlane.vNormal.x + 308 * v6 + 292);
           }*/
-		  if ( BYTE3(v7[v6].uAttributes) & 4 )
+		  if ( BYTE3(face[v6].uAttributes) & 4 )
           {
             pParty->floor_face_pid = PID(OBJECT_BModel, bmodel_standing_on_pid);
-            v103 = v7[v6].sCogTriggeredID;
+            v103 = face[v6].sCogTriggeredID;
           }
         }
       }
@@ -2421,10 +2421,19 @@
               cos_y = cosf(2 * 3.141592653589 * _angle_y / 2048.0);
 
         int dx = cos_y * pParty->uWalkSpeed * fWalkSpeedMultiplier;
-        v2 += dx;// * 12;
-        
         int dy = sin_y * pParty->uWalkSpeed * fWalkSpeedMultiplier;
-        v1 += dy;// * 12;
+
+        extern bool new_speed;
+        if ( new_speed )
+        {
+          v2 += dx * 12;
+          v1 += dy * 12;
+        }
+        else
+        {
+          v2 += dx;
+          v1 += dy;
+        }
 
         v128 = v1;
         party_walking_flag = true;
@@ -2759,7 +2768,7 @@
       if (pParty->Invisible())
         pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset();
 
-      viewparams->bRedrawGameUI = 1;
+      viewparams->bRedrawGameUI = true;
 		v2 = (unsigned __int64)(58500i64 * v2) >> 16;
 		pModel = (BSPModel *)58500;
 		v128 = (unsigned __int64)(58500i64 * v128) >> 16;