changeset 2448:7948957d9178

* sudden drop while flying fixed * ~AudioPlayer * free pSoundHeaders
author zipi
date Thu, 24 Jul 2014 18:14:26 +0100
parents 45dcf81c5b1c
children e40805af239b
files AudioPlayer.cpp AudioPlayer.h mm7_4.cpp
diffstat 3 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/AudioPlayer.cpp	Thu Jul 24 12:50:24 2014 +0600
+++ b/AudioPlayer.cpp	Thu Jul 24 18:14:26 2014 +0100
@@ -2346,6 +2346,7 @@
 
   if ( this->bPlayerReady )
   {
+	free(pSoundHeaders);
     CloseHandle(hMagicVid);
     CloseHandle(hMightVid);
     pAudioPlayer->StopChannels(-1, -1);
--- a/AudioPlayer.h	Thu Jul 24 12:50:24 2014 +0600
+++ b/AudioPlayer.h	Thu Jul 24 18:14:26 2014 +0100
@@ -162,7 +162,7 @@
     field_2D4 = 0;
     s3DSoundVolume = 127;
   }
-
+  inline ~AudioPlayer(){ Release(); };
   void SetMusicVolume(int vol);
   void SetMasterVolume(float fVolume);
   void _4AA258(int a2);
--- a/mm7_4.cpp	Thu Jul 24 12:50:24 2014 +0600
+++ b/mm7_4.cpp	Thu Jul 24 18:14:26 2014 +0100
@@ -213,7 +213,7 @@
   int last_reg_time; // qax@1
   int v4; // eax@2
   int v5; // edi@5
-  bool cursed_flag; // ecx@5
+  long long *v6; // ecx@5
   char v7; // sf@5
   int *v8; // ecx@10
   int v9; // edi@15
@@ -258,11 +258,15 @@
         if ( !(pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags & 1) )
         {
           v5 = v4 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uPower;
-          cursed_flag = pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].pConditions[Condition_Cursed];//cursed
-          v7 = cursed_flag < v5;
+          //cursed_flag = pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].pConditions[Condition_Cursed];//cursed
+          //v7 = cursed_flag < v5;
           //cursed_flag -= v5;
-          if ( !v7 )
+
+		  v6 = &pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].pConditions[Condition_Cursed];
+
+          if ( *v6 < v5 )
           {
+			v6 = 0;
             pParty->uFlags &= 0xFFFFFFBFu;
             pParty->bFlying = false;
             redraw_flag = true;