changeset 1775:0abc0db1ea56

Player::SetVariable removing LABEL_124
author Grumpy7
date Tue, 01 Oct 2013 09:51:33 +0200
parents 097d72afd20f
children 0f273c459f78
files Player.cpp
diffstat 1 files changed, 110 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/Player.cpp	Tue Oct 01 09:49:16 2013 +0200
+++ b/Player.cpp	Tue Oct 01 09:51:33 2013 +0200
@@ -5621,38 +5621,104 @@
           sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], v7);// You have %lu food
           ShowStatusBarString(pTmpBuf.data(), 2u);
           GameUI_DrawFoodAndGold();
-          goto LABEL_124;
+          v31 = 1;
+          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_Sex:
           this->uSex = (PLAYER_SEX)var_value;
-          goto LABEL_124;
+          v31 = 1;
+          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_Class:
           this->classType = (PLAYER_CLASS_TYPE)var_value;
           if ( (char)var_value != 35 )
-            goto LABEL_124;
+          {
+            v31 = 1;
+            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;
+          }
           v8 = 0;
           v9 = this->pInventoryItemList;
           break;
         case VAR_CurrentHP:
           this->sHealth = var_value;
-          goto LABEL_124;
+          v31 = 1;
+          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_MaxHP:
           this->sHealth = GetMaxHealth();
           return;
         case VAR_CurrentSP:
           this->sMana = var_value;
-          goto LABEL_124;
+          v31 = 1;
+          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_MaxSP:
           this->sMana = GetMaxMana();
           return;
         case VAR_ACModifier:
           this->sACModifier = (unsigned __int8)var_value;
-          goto LABEL_124;
+          v31 = 1;
+          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_BaseLevel:
           this->uLevel = (unsigned __int8)var_value;
-          goto LABEL_124;
+          v31 = 1;
+          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_LevelModifier:
           this->sLevelModifier = (unsigned __int8)var_value;
-          goto LABEL_124;
+          v31 = 1;
+          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_Age:
           this->sAgeModifier = var_value;
           return;
@@ -5689,7 +5755,15 @@
           return;
         case VAR_Experience:
           this->uExperience = var_value;
-          goto LABEL_124;
+          v31 = 1;
+          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_QBits_QuestsDone:
           if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & pParty->_quest_bits[((signed __int16)var_value - 1) >> 3])
            // && (&dword_722F10)[4 * a3] )
@@ -5841,7 +5915,15 @@
           return;
         case VAR_FixedFood:
           Party::SetFood(var_value);
-          goto LABEL_124;
+          v31 = 1;
+          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_MightBonus:
           goto LABEL_64;
         case VAR_IntellectBonus:
@@ -5894,7 +5976,15 @@
         v4->uVoiceID = 20;
       }
       ReloadPlayerPortraits(currPlayerId, v4->uCurrentFace);
-      goto LABEL_124;
+      v31 = 1;
+      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;
     }
 LABEL_64:
     this->uMightBonus = (unsigned __int8)var_value;
@@ -6205,7 +6295,6 @@
         }
         memset(v4, 0, 0xA0u);
       }
-LABEL_124:
       v31 = 1;
       pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
       if ( v31 != 1 )
@@ -6229,7 +6318,15 @@
       LOWORD(v18) = (unsigned __int8)(var_value | v17 & 0xC0);
     }
     *(short *)v16 = v18;
-    goto LABEL_124;
+    v31 = 1;
+    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;
   }
   if ( var_type == VAR_DisarmTrapSkill )
 	  if ( v30 != 1 )