# HG changeset patch # User Grumpy7 # Date 1380613893 -7200 # Node ID 0abc0db1ea566cec9e83d2267334011132a8e23b # Parent 097d72afd20fa14fbf2d5b6e1af524ed2e7fa116 Player::SetVariable removing LABEL_124 diff -r 097d72afd20f -r 0abc0db1ea56 Player.cpp --- 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 )