changeset 1776:0f273c459f78

Player::SetVariable PlaySound and SetPlayerBuffAnim labels restored to original state
author Grumpy7
date Wed, 02 Oct 2013 05:47:30 +0200
parents 0abc0db1ea56
children 47606ed5ffba
files Player.cpp
diffstat 1 files changed, 119 insertions(+), 149 deletions(-) [+]
line wrap: on
line diff
--- a/Player.cpp	Tue Oct 01 09:51:33 2013 +0200
+++ b/Player.cpp	Wed Oct 02 05:47:30 2013 +0200
@@ -6305,157 +6305,127 @@
       pAudioPlayer->PlaySound(SOUND_20001, v25, v5, -1, v5, v5, v5, v5);
       return;
     }
-LABEL_106:
-    v16 = (int)((char *)&v4->pConditions[16] + 2 * var_type);
-    v17 = *(char *)v16;
-    if ( var_value <= VAR_BodyResistanceBonus )
-    {
-      LOWORD(v15) = (unsigned __int8)var_value;
-      v18 = v15 | v17 & VAR_BodyResistanceBonus;
-    }
-    else
-    {
-      LOWORD(v18) = (unsigned __int8)(var_value | v17 & 0xC0);
-    }
-    *(short *)v16 = v18;
-    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 )
-		  {
-		  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;
-		  }
-    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_BodyResistanceBonus )
-  {
-    switch ( var_type )
-    {
-      case VAR_BodyResistanceBonus:
-        v4->sResBodyBonus = (unsigned __int8)var_value;
-        break;
-      case VAR_AirResistanceBonus:
-        v4->sResAirBonus = (unsigned __int8)var_value;
-        break;
-      case VAR_WaterResistanceBonus:
-        v4->sResWaterBonus = (unsigned __int8)var_value;
-        break;
-      case VAR_EarthResistanceBonus:
-        v4->sResEarthBonus = (unsigned __int8)var_value;
-        break;
-      case VAR_SpiritResistanceBonus:
-        v4->sResSpiritBonus = (unsigned __int8)var_value;
-        break;
-      default:
-        if ( var_type != 62 )
+  }
+  else
+  {
+    if (var_type != VAR_DisarmTrapSkill)
+    {
+      if ( var_type <= VAR_BodyResistanceBonus )
+      {
+        switch ( var_type )
+        {
+        case VAR_BodyResistanceBonus:
+          v4->sResBodyBonus = (unsigned __int8)var_value;
+          break;
+        case VAR_AirResistanceBonus:
+          v4->sResAirBonus = (unsigned __int8)var_value;
+          break;
+        case VAR_WaterResistanceBonus:
+          v4->sResWaterBonus = (unsigned __int8)var_value;
+          break;
+        case VAR_EarthResistanceBonus:
+          v4->sResEarthBonus = (unsigned __int8)var_value;
+          break;
+        case VAR_SpiritResistanceBonus:
+          v4->sResSpiritBonus = (unsigned __int8)var_value;
+          break;
+        default:
+          if ( var_type != 62 )
+            return;
+          v4->sResMindBonus = (unsigned __int8)var_value;
+          break;
+        }
+        v28 = 0;
+        v26 = SPEECH_91;
+        v19 = pPlayers[currPlayerId + 1];
+        v31 = 1;
+        v19->PlaySound((PlayerSpeech)v26, v28);
+        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_LightResistanceBonus )
+      {
+        v4->sResLightBonus = (unsigned __int8)var_value;
+        v28 = 0;
+        v26 = SPEECH_91;
+        v19 = pPlayers[currPlayerId + 1];
+        v31 = 1;
+        v19->PlaySound((PlayerSpeech)v26, v28);
+        pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
+        if ( v31 != 1 )
           return;
-        v4->sResMindBonus = (unsigned __int8)var_value;
-        break;
-    }
-    v28 = 0;
-    v26 = SPEECH_91;
-    v19 = pPlayers[currPlayerId + 1];
-    v31 = 1;
-    v19->PlaySound((PlayerSpeech)v26, v28);
-    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_LightResistanceBonus )
-  {
-    v4->sResLightBonus = (unsigned __int8)var_value;
-    v28 = 0;
-    v26 = SPEECH_91;
-    v19 = pPlayers[currPlayerId + 1];
-    v31 = 1;
-    v19->PlaySound((PlayerSpeech)v26, v28);
-    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);
+        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_DarkResistanceBonus )
+      {
+        v4->sResDarkBonus = (unsigned __int8)var_value;
+        v28 = 0;
+        v26 = SPEECH_91;
+        v19 = pPlayers[currPlayerId + 1];
+        v31 = 1;
+        v19->PlaySound((PlayerSpeech)v26, v28);
+        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_MagicResistanceBonus )
+      {
+        v4->sResMagicBonus = (unsigned __int8)var_value;
+        v28 = 0;
+        v26 = SPEECH_91;
+        v19 = pPlayers[currPlayerId + 1];
+        v31 = 1;
+        v19->PlaySound((PlayerSpeech)v26, v28);
+        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 <= 67 || var_type > 95 )
+        return;
+    }
+  }
+  
+  v16 = (int)((char *)&v4->pConditions[16] + 2 * var_type);
+  v17 = *(char *)v16;
+  if ( var_value <= VAR_BodyResistanceBonus )
+  {
+    LOWORD(v15) = (unsigned __int8)var_value;
+    v18 = v15 | v17 & VAR_BodyResistanceBonus;
+  }
+  else
+  {
+    LOWORD(v18) = (unsigned __int8)(var_value | v17 & 0xC0);
+  }
+  *(short *)v16 = v18;
+  v31 = 1;
+  pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
+  if ( v31 != 1 )
     return;
-  }
-  if ( var_type == VAR_DarkResistanceBonus )
-  {
-    v4->sResDarkBonus = (unsigned __int8)var_value;
-    v28 = 0;
-    v26 = SPEECH_91;
-    v19 = pPlayers[currPlayerId + 1];
-    v31 = 1;
-    v19->PlaySound((PlayerSpeech)v26, v28);
-    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_MagicResistanceBonus )
-  {
-    v4->sResMagicBonus = (unsigned __int8)var_value;
-    v28 = 0;
-    v26 = SPEECH_91;
-    v19 = pPlayers[currPlayerId + 1];
-    v31 = 1;
-    v19->PlaySound((PlayerSpeech)v26, v28);
-    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_MagicResistanceBonus && var_type <= VAR_DiplomacySkill )
-	  if ( v30 != 1 )
-		  {
-		  if ( v31 != 1 )
-			  return;
-		  v5 = 0;
-		  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;
-    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;
+  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;
 }