diff Player.cpp @ 1507:a109bb203e28

UIGame.cpp cleaning(continue) GameUI_DrawMinimap
author Ritor1
date Mon, 02 Sep 2013 17:30:50 +0600
parents 845907a747d3
children a2e1174c428b
line wrap: on
line diff
--- a/Player.cpp	Mon Sep 02 12:03:40 2013 +0600
+++ b/Player.cpp	Mon Sep 02 17:30:50 2013 +0600
@@ -7547,15 +7547,20 @@
               goto _play_sound;
             case VAR_Sex:
               Dst->uSex = (PLAYER_SEX)val;
-              goto _play_anim_and_exit;
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              goto _play_sound;
             case VAR_Class:
               Dst->classType = (PLAYER_CLASS_TYPE)val;
-              goto _play_anim_and_exit;
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              goto _play_sound;
             case VAR_CurrentHP:
               v8 = &Dst->sHealth;
               *v8 += val;
               if ( Dst->sHealth <= Dst->GetMaxHealth() )
-                goto _play_anim_and_exit;
+              {
+                pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+                goto _play_sound;
+              }
               v9 = v4->GetMaxHealth();
               goto LABEL_23;
             case VAR_MaxHP:
@@ -7573,7 +7578,8 @@
 LABEL_23:
                 *v8 = v9;
               }
-              goto _play_anim_and_exit;
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              goto _play_sound;
             case VAR_MaxSP:
               v11 = GetMaxMana();
               v4->_mana_related = 0;
@@ -7592,7 +7598,8 @@
               *v12 += val;
               if ( *v12 > 255 )
                 *v12 = 255;
-              goto _play_anim_and_exit;
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              goto _play_sound;
             case VAR_Age:
               Dst->sAgeModifier += val;
               return;
@@ -7608,14 +7615,25 @@
                 v14->PlaySound(SPEECH_96, 0);
               }
               v15 = (char *)v4->_achieved_awards_bits;
-              goto LABEL_44;
+              _449B7E_toggle_bit((unsigned char *)v15, val, 1);
+              if ( v34 != 1 )
+              {
+                if ( v3 != 1 )
+                  return;
+                goto _play_sound;
+              }
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              if ( v3 != 1 )
+                return;
+              goto _play_sound;
             case VAR_Experience:
               v16 = __CFADD__(val, LODWORD(Dst->uExperience));
               LODWORD(Dst->uExperience) += val;
               HIDWORD(Dst->uExperience) += ((unsigned __int64)val >> 32) + v16;
               if ( (signed __int64)Dst->uExperience > 4000000000i64 )
                 Dst->uExperience = 4000000000i64;
-              goto _play_anim_and_exit;
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              goto _play_sound;
             case VAR_QBits_QuestsDone:
               if ( !((unsigned __int8)(0x80u >> ((signed __int16)val - 1) % 8) & pParty->_quest_bits[((signed __int16)val - 1) >> 3])
                 //&& (&dword_722F10)[4 * val] )
@@ -7628,9 +7646,17 @@
                 pPlayers[uPlayerIdx + 1]->PlaySound(SPEECH_93, 0);
               }
               v15 = (char *)pParty->_quest_bits;
-LABEL_44:
-              _449B7E_toggle_bit((unsigned char *)v15, val, 1u);
-              goto LABEL_173;
+              _449B7E_toggle_bit((unsigned char *)v15, val, 1);
+              if ( v34 != 1 )
+              {
+                if ( v3 != 1 )
+                  return;
+                goto _play_sound;
+              }
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              if ( v3 != 1 )
+                return;
+              goto _play_sound;
             case VAR_PlayerItemInHands:
               item.Reset();
               item.Reset();
@@ -7762,9 +7788,9 @@
               *v18 += val;
               if ( *v18 > 255 )
                 *v18 = 255;
-              v31 = 0;
-              v29 = 92;
-              goto LABEL_116;
+              pPlayers[uPlayerIdx + 1]->PlaySound(SPEECH_92, 0);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              goto _play_sound;
             default:
               return;
           }
@@ -7777,10 +7803,9 @@
           *v19 = 255;
         v31 = 0;
         v29 = SPEECH_91;
-LABEL_116:
-        v3 = 1;
         pPlayers[uPlayerIdx + 1]->PlaySound((PlayerSpeech)v29, v31);
-        goto _play_anim_and_maybe_sound;
+        pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+        goto _play_sound;
       }
       if ( var_type <= VAR_DisarmTrapSkill )
       {
@@ -7850,7 +7875,8 @@
           LOBYTE(v21) = v21 & 0xC0;
           *(short *)v20 = v22 | v21;
         }
-        goto _play_anim_and_exit;
+        pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+        goto _play_sound;
       }
       if ( var_type <= VAR_LearningSkill )
         return;
@@ -7873,13 +7899,7 @@
         }
         memset(Dst, 0, 0xA0u);
       }
-_play_anim_and_exit:
-      v3 = 1;
-_play_anim_and_maybe_sound:
       pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
-_maybe_play_sound:
-      if ( v3 != 1 )
-        return;
       goto _play_sound;
     }
     if ( !((unsigned __int8)(0x80u >> ((signed __int16)val - 1) % 8) & pParty->_autonote_bits[((signed __int16)val - 1) >> 3])
@@ -7895,17 +7915,32 @@
     }
     _449B7E_toggle_bit(pParty->_autonote_bits, val, 1);
     v3 = 1;
-LABEL_173:
     if ( v34 != 1 )
-      goto _maybe_play_sound;
-    goto _play_anim_and_maybe_sound;
+    {
+      if ( v3 != 1 )
+        return;
+      goto _play_sound;
+    }
+    pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+    if ( v3 != 1 )
+      return;
+    goto _play_sound;
   }
   if ( var_type > VAR_GoldInBank )
   {
     if ( var_type == 307 )
     {
       pParty->uNumDeaths += val;
-      goto LABEL_173;
+      if ( v34 != 1 )
+      {
+        if ( v3 != 1 )
+          return;
+        goto _play_sound;
+      }
+      pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+      if ( v3 != 1 )
+        return;
+      goto _play_sound;
     }
     switch ( var_type )
     {