changeset 1778:4e881879e259

Player::SetVariable SetPlayerBuffAnim and pAudioPlayer->PlaySound(SOUND_20001,...) condition vars removal
author Grumpy7
date Wed, 02 Oct 2013 07:42:43 +0200
parents 47606ed5ffba
children 50e91a820f6f
files Player.cpp
diffstat 1 files changed, 9 insertions(+), 196 deletions(-) [+]
line wrap: on
line diff
--- a/Player.cpp	Wed Oct 02 07:03:23 2013 +0200
+++ b/Player.cpp	Wed Oct 02 07:42:43 2013 +0200
@@ -5540,21 +5540,6 @@
       return;
     }
     pParty->uNumDeaths = var_value;
-    if ( v30 != 1 )
-    {
-      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;
-    }
-    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;
   }
   if ( var_type == VAR_AutoNotes )
@@ -5563,26 +5548,13 @@
       //&& (&dword_723718_autonote_related)[8 * a3] )
 	  && pAutonoteTxt[var_value-1].pText )
     {
-      v30 = 1;
+      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
       this->PlaySound(SPEECH_96, 0);
 	    v21 = pAutonoteTxt[var_value-1].eType;// dword_72371C[2 * a3];
       bFlashAutonotesBook = 1;
       _506568_autonote_type = v21;
     }
     _449B7E_toggle_bit(pParty->_autonote_bits, var_value, 1u);
-    v31 = 1;
-    if ( v30 != 1 )
-    {
-      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;
-    }
-    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);
@@ -5607,20 +5579,14 @@
           sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], v7);// You have %lu food
           ShowStatusBarString(pTmpBuf.data(), 2u);
           GameUI_DrawFoodAndGold();
-          v31 = 1;
           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;
         case VAR_Sex:
           this->uSex = (PLAYER_SEX)var_value;
-          v31 = 1;
           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);
@@ -5629,10 +5595,7 @@
           this->classType = (PLAYER_CLASS_TYPE)var_value;
           if ( (char)var_value != 35 )
           {
-            v31 = 1;
             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);
@@ -5643,10 +5606,7 @@
           break;
         case VAR_CurrentHP:
           this->sHealth = var_value;
-          v31 = 1;
           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);
@@ -5656,10 +5616,7 @@
           return;
         case VAR_CurrentSP:
           this->sMana = var_value;
-          v31 = 1;
           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);
@@ -5669,30 +5626,21 @@
           return;
         case VAR_ACModifier:
           this->sACModifier = (unsigned __int8)var_value;
-          v31 = 1;
           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;
         case VAR_BaseLevel:
           this->uLevel = (unsigned __int8)var_value;
-          v31 = 1;
           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;
         case VAR_LevelModifier:
           this->sLevelModifier = (unsigned __int8)var_value;
-          v31 = 1;
           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);
@@ -5706,37 +5654,17 @@
             //&& dword_723E80_award_related[2 * a3] )
 			&& pAwards[var_value].pText )
           {
-            v30 = 1;
-            v31 = 1;
+            v25 = 8 * currPlayerId + 400;
+            LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112);
+            pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0);
+            pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
             this->PlaySound(SPEECH_96, 0);
           }
           _449B7E_toggle_bit((unsigned char *)this->_achieved_awards_bits, var_value, 1u);
-          if ( v30 != 1 )
-          {
-            if ( v31 == 1 )
-            {
-              v25 = 8 * currPlayerId + 400;
-              LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112);
-              pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0);
-              return;
-            }
-            return;
-          }
-          pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-          if ( v31 == 1 )
-          {
-            v25 = 8 * currPlayerId + 400;
-            LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112);
-            pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0);
-            return;
-          }
           return;
         case VAR_Experience:
           this->uExperience = var_value;
-          v31 = 1;
           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);
@@ -5747,29 +5675,13 @@
 		   && pQuestTable[var_value-1] )
           {
             bFlashQuestBook = 1;
-            v30 = 1;
-            v31 = 1;
+            v25 = 8 * currPlayerId + 400;
+            LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112);
+            pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0);
+            pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
             this->PlaySound(SPEECH_93, 0);
           }
           _449B7E_toggle_bit((unsigned char *)pParty->_quest_bits, var_value, 1u);
-          if ( v30 != 1 )
-          {
-            if ( v31 == 1 )
-            {
-              v25 = 8 * currPlayerId + 400;
-              LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112);
-              pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0);
-              return;
-            }
-            return;
-          }
-          pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-          if ( v31 == 1 )
-          {
-            v25 = 8 * currPlayerId + 400;
-            LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112);
-            pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0);
-          }
           return;
         case VAR_PlayerItemInHands:
           item.Reset();
@@ -5785,87 +5697,63 @@
           return;
         case VAR_BaseMight:
           this->uMight = (unsigned __int8)var_value;
-          v31 = 1;
           this->PlaySound(SPEECH_92, 0);
           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;
         case VAR_BaseIntellect:
           this->uIntelligence = (unsigned __int8)var_value;
-          v31 = 1;
           this->PlaySound(SPEECH_92, 0);
           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;
         case VAR_BasePersonality:
           this->uWillpower = (unsigned __int8)var_value;
-          v31 = 1;
           this->PlaySound(SPEECH_92, 0);
           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;
         case VAR_BaseEndurance:
           this->uEndurance = (unsigned __int8)var_value;
-          v31 = 1;
           this->PlaySound(SPEECH_92, 0);
           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;
         case VAR_BaseSpeed:
           this->uSpeed = (unsigned __int8)var_value;
-          v31 = 1;
           this->PlaySound(SPEECH_92, 0);
           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;
         case VAR_BaseAccuracy:
           this->uAccuracy = (unsigned __int8)var_value;
-          v31 = 1;
           this->PlaySound(SPEECH_92, 0);
           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;
         case VAR_BaseLuck:
           this->uLuck = (unsigned __int8)var_value;
-          v31 = 1;
           this->PlaySound(SPEECH_92, 0);
           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;
         case VAR_FixedFood:
           Party::SetFood(var_value);
-          v31 = 1;
           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);
@@ -5922,10 +5810,7 @@
         this->uVoiceID = 20;
       }
       ReloadPlayerPortraits(currPlayerId, this->uCurrentFace);
-      v31 = 1;
       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);
@@ -5933,11 +5818,8 @@
     }
 LABEL_64:
     this->uMightBonus = (unsigned __int8)var_value;
-    v31 = 1;
     this->PlaySound(SPEECH_91, 0);
     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);
@@ -5948,11 +5830,8 @@
     if ( var_type == VAR_FireResistanceBonus )
     {
       this->sResFireBonus = (unsigned __int8)var_value;
-      v31 = 1;
       this->PlaySound(SPEECH_91, 0);
       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);
@@ -5963,11 +5842,8 @@
       case VAR_ActualIntellect:
 LABEL_68:
         this->uIntelligenceBonus = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_91, 0);
         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);
@@ -5975,11 +5851,8 @@
       case VAR_ActualPersonality:
 LABEL_69:
         this->uWillpowerBonus = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_91, 0);
         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);
@@ -5987,11 +5860,8 @@
       case VAR_ActualEndurance:
 LABEL_70:
         this->uEnduranceBonus = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_91, 0);
         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);
@@ -5999,11 +5869,8 @@
       case VAR_ActualSpeed:
 LABEL_71:
         this->uSpeedBonus = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_91, 0);
         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);
@@ -6011,11 +5878,8 @@
       case VAR_ActualAccuracy:
 LABEL_72:
         this->uAccuracyBonus = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_92, 0);
         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);
@@ -6023,121 +5887,88 @@
       case VAR_ActualLuck:
 LABEL_73:
         this->uLuckBonus = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_92, 0);
         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;
       case VAR_FireResistance:
         this->sResFireBase = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_92, 0);
         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;
       case VAR_AirResistance:
         this->sResAirBase = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_92, 0);
         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;
       case VAR_WaterResistance:
         this->sResWaterBase = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_92, 0);
         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;
       case VAR_EarthResistance:
         this->sResEarthBase = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_92, 0);
         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;
       case VAR_SpiritResistance:
         this->sResSpiritBase = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_92, 0);
         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;
       case VAR_MindResistance:
         this->sResMindBase = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_92, 0);
         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;
       case VAR_BodyResistance:
         this->sResBodyBase = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_92, 0);
         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;
       case VAR_LightResistance:
         this->sResLightBase = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_92, 0);
         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;
       case VAR_DarkResistance:
         this->sResDarkBase = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_92, 0);
         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;
       case VAR_MagicResistance:
         this->sResMagicBase = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_92, 0);
         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);
@@ -6168,10 +5999,7 @@
         }
         memset(this, 0, 0xA0u);
       }
-      v31 = 1;
       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);
@@ -6207,11 +6035,8 @@
           this->sResMindBonus = (unsigned __int8)var_value;
           break;
         }
-        v31 = 1;
         this->PlaySound(SPEECH_91, 0);
         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);
@@ -6220,11 +6045,8 @@
       if ( var_type == VAR_LightResistanceBonus )
       {
         this->sResLightBonus = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_91, 0);
         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);
@@ -6233,11 +6055,8 @@
       if ( var_type == VAR_DarkResistanceBonus )
       {
         this->sResDarkBonus = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_91, 0);
         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);
@@ -6246,11 +6065,8 @@
       if ( var_type == VAR_MagicResistanceBonus )
       {
         this->sResMagicBonus = (unsigned __int8)var_value;
-        v31 = 1;
         this->PlaySound(SPEECH_91, 0);
         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);
@@ -6273,10 +6089,7 @@
     LOWORD(v18) = (unsigned __int8)(var_value | v17 & 0xC0);
   }
   *(short *)v16 = v18;
-  v31 = 1;
   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);