diff Player.cpp @ 1772:c0b32e8a82c8

Player::SetVariable restoring and fixing LABEL_51
author Grumpy7
date Tue, 01 Oct 2013 09:45:32 +0200
parents 6c1823e19c2e
children 8e16cf2c7b1b
line wrap: on
line diff
--- a/Player.cpp	Tue Oct 01 07:36:27 2013 +0200
+++ b/Player.cpp	Tue Oct 01 09:45:32 2013 +0200
@@ -5669,21 +5669,23 @@
           _449B7E_toggle_bit((unsigned char *)v4->_achieved_awards_bits, var_value, 1u);
           if ( v30 != 1 )
           {
-            if ( v31 != 1 )
+            if ( v31 == 1 )
+            {
+              v5 = 0;
+              v25 = 8 * currPlayerId + 400;
+              LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112);
+              pAudioPlayer->PlaySound(SOUND_20001, v25, v5, -1, v5, v5, v5, v5);
               return;
+            }
+          }
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
+          if ( v31 == 1 )
+          {
             v5 = 0;
             v25 = 8 * currPlayerId + 400;
             LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112);
             pAudioPlayer->PlaySound(SOUND_20001, v25, v5, -1, v5, v5, v5, v5);
-            return;
           }
-          pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-          if ( v31 != 1 )
-            return;
-          v5 = 0;
-          v25 = 8 * currPlayerId + 400;
-          LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112);
-          pAudioPlayer->PlaySound(SOUND_20001, v25, v5, -1, v5, v5, v5, v5);
           return;
         case VAR_Experience:
           this->uExperience = var_value;
@@ -5699,19 +5701,27 @@
             v31 = 1;
             v14->PlaySound(SPEECH_93, 0);
           }
-          v13 = (char *)pParty->_quest_bits;
-LABEL_51:
-          _449B7E_toggle_bit((unsigned char *)v13, var_value, 1u);
-		  if (( v30 != 1 )&&( v31 != 1 ))
-				  return;
-		  else
-			  pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-		  if ( v31 != 1 )
-			  return;
-		  v25 = 8 * currPlayerId + 400;
-		  LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112);
-		  pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0);
-		  return;
+          _449B7E_toggle_bit((unsigned char *)pParty->_quest_bits, var_value, 1u);
+          if ( v30 != 1 )
+          {
+            if ( v31 == 1 )
+            {
+              v5 = 0;
+              v25 = 8 * currPlayerId + 400;
+              LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112);
+              pAudioPlayer->PlaySound(SOUND_20001, v25, v5, -1, v5, v5, v5, v5);
+              return;
+            }
+          }
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
+          if ( v31 == 1 )
+          {
+            v5 = 0;
+            v25 = 8 * currPlayerId + 400;
+            LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112);
+            pAudioPlayer->PlaySound(SOUND_20001, v25, v5, -1, v5, v5, v5, v5);
+          }
+          return;
         case VAR_PlayerItemInHands:
           item.Reset();
           item.Reset();