changeset 2030:47ab41698f9d

sudden drop in flight fix
author Ritor1
date Mon, 18 Nov 2013 13:17:12 +0600
parents 81a0e6819d3f
children b9e11e88b157
files mm7_3.cpp mm7_4.cpp
diffstat 2 files changed, 43 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/mm7_3.cpp	Mon Nov 18 10:07:24 2013 +0600
+++ b/mm7_3.cpp	Mon Nov 18 13:17:12 2013 +0600
@@ -2228,7 +2228,7 @@
   }
   else
     hovering = true;
-  high_fall_flag = pZ - v111 > 32;
+  high_fall_flag = pZ - v111 <= 32;
 
   if ( bWalkSound && pParty->walk_sound_timer)//timer update
   {
@@ -2550,9 +2550,6 @@
         }
       break;
 
-      default:
-        assert(false);
-
       case PARTY_Land:
         if (pParty->bFlying)
         {
@@ -2562,6 +2559,11 @@
         pParty->bFlying = false;
         pPartyActionQueue->uNumActions = 0;
       break;
+
+      default:
+        assert(false);
+
+
     }
   }
 
@@ -3036,7 +3038,7 @@
     }
     return;
   }
-  v76 = pParty->bFlying;
+  //v76 = pParty->bFlying;
   if ( pParty->bFlying || !high_fall_flag || bWaterWalk || !pModel )
     v77 = 1;
   else
@@ -3076,7 +3078,7 @@
       *(short *)v79 |= 1u;
       if ( !v122 || !v69 )
       {
-        if ( !v76 )
+        if ( !pParty->bFlying )
         {
           v80 = *(short *)v79;
           pParty->uFlags |= PARTY_FLAGS_1_STANDING_ON_WATER;
--- a/mm7_4.cpp	Mon Nov 18 10:07:24 2013 +0600
+++ b/mm7_4.cpp	Mon Nov 18 13:17:12 2013 +0600
@@ -547,7 +547,7 @@
   int result; // eax@1
   int v4; // eax@2
   int v5; // edi@5
-  int *v6; // ecx@5
+  bool cursed_flag; // ecx@5
   char v7; // sf@5
   int *v8; // ecx@10
   int v9; // edi@15
@@ -607,17 +607,15 @@
       if ( pParty->bFlying )
       {
         if ( !(pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags & 1) )
-        { // colliding with something in the air - fall down
+        {
           v5 = v4 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uPower;
-          //__debugbreak();
-		  v6 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster + 2000];
-          v7 = *v6 < v5;
-          *v6 -= v5;
-          if ( v7 )
+          cursed_flag = pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].pConditions[0];//cursed
+          v7 = cursed_flag < v5;
+          //cursed_flag -= v5;
+          if ( !v7 )
           {
-            *v6 = 0;
             pParty->uFlags &= 0xFFFFFFBFu;
-            pParty->bFlying = 0;
+            pParty->bFlying = false;
             v51 = 1;
           }
         }
@@ -732,9 +730,16 @@
         if ( v24 > 134 )
         {
           if ( v24 == 529 )
-            goto LABEL_43;
+          {
+            v20 = 1;
+            v50 = 1;
+            goto LABEL_51;
+          }
           if ( v24 == 535 )
-            goto LABEL_44;
+          {
+            v20 = 1;
+            goto LABEL_51;
+          }
           if ( v24 == 515 )
           {
             v47 = 1;
@@ -742,7 +747,10 @@
           else
           {
             if ( v24 == 532 )
-              goto LABEL_50;
+            {
+              v50 = 1;
+              goto LABEL_51;
+            }
           }
         }
         else
@@ -757,31 +765,40 @@
               {
                 v27 = v26 - 1;
                 if ( !v27 )
-                  goto LABEL_50;
+                {
+                  v50 = 1;
+                  goto LABEL_51;
+                }
                 v28 = v27 - 6;
                 if ( v28 )
                 {
                   if ( v28 != 3 )
                     goto LABEL_51;
-LABEL_50:
+//LABEL_50:
                   v50 = 1;
                   goto LABEL_51;
                 }
               }
             }
-LABEL_44:
+//LABEL_44:
             v20 = 1;
             goto LABEL_51;
           }
           v29 = v25 - 54;
           if ( !v29 )
-            goto LABEL_44;
+          {
+            v20 = 1;
+            goto LABEL_51;
+          }
           v30 = v29 - 1;
           if ( !v30 )
-            goto LABEL_50;
+          {
+            v50 = 1;
+            goto LABEL_51;
+          }
           if ( v30 == 11 )
           {
-LABEL_43:
+//LABEL_43:
             v20 = 1;
             v50 = 1;
             goto LABEL_51;