diff options
author | peterbell10 <peterbell10@live.co.uk> | 2018-07-27 01:12:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-27 01:12:41 +0200 |
commit | cdd8e425872b94878babf7823cd12381d2db1a5c (patch) | |
tree | fea666b4d4c4e10da6a957a0e403c747dbd74ef9 /src/UI/SlotArea.cpp | |
parent | CheckBasicStyle: Check number of empty lines between functions (#4267) (diff) | |
download | cuberite-cdd8e425872b94878babf7823cd12381d2db1a5c.tar cuberite-cdd8e425872b94878babf7823cd12381d2db1a5c.tar.gz cuberite-cdd8e425872b94878babf7823cd12381d2db1a5c.tar.bz2 cuberite-cdd8e425872b94878babf7823cd12381d2db1a5c.tar.lz cuberite-cdd8e425872b94878babf7823cd12381d2db1a5c.tar.xz cuberite-cdd8e425872b94878babf7823cd12381d2db1a5c.tar.zst cuberite-cdd8e425872b94878babf7823cd12381d2db1a5c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/UI/SlotArea.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index d6b870d0e..19c75d196 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -1003,6 +1003,7 @@ void cSlotAreaAnvil::OnTakeResult(cPlayer & a_Player) NIBBLETYPE BlockMeta; a_Player.GetWorld()->GetBlockTypeMeta(PosX, PosY, PosZ, Block, BlockMeta); + const Vector3i BlockPos{PosX, PosY, PosZ}; if (!a_Player.IsGameModeCreative() && (Block == E_BLOCK_ANVIL) && GetRandomProvider().RandBool(0.12)) { NIBBLETYPE Orientation = BlockMeta & 0x3; @@ -1013,18 +1014,18 @@ void cSlotAreaAnvil::OnTakeResult(cPlayer & a_Player) { // Anvil will break a_Player.GetWorld()->SetBlock(PosX, PosY, PosZ, E_BLOCK_AIR, 0); - a_Player.GetWorld()->BroadcastSoundParticleEffect(EffectID::SFX_RANDOM_ANVIL_BREAK, PosX, PosY, PosZ, 0); + a_Player.GetWorld()->BroadcastSoundParticleEffect(EffectID::SFX_RANDOM_ANVIL_BREAK, BlockPos, 0); a_Player.CloseWindow(false); } else { a_Player.GetWorld()->SetBlockMeta(PosX, PosY, PosZ, static_cast<NIBBLETYPE>(Orientation | (AnvilDamage << 2))); - a_Player.GetWorld()->BroadcastSoundParticleEffect(EffectID::SFX_RANDOM_ANVIL_USE, PosX, PosY, PosZ, 0); + a_Player.GetWorld()->BroadcastSoundParticleEffect(EffectID::SFX_RANDOM_ANVIL_USE, BlockPos, 0); } } else { - a_Player.GetWorld()->BroadcastSoundParticleEffect(EffectID::SFX_RANDOM_ANVIL_USE, PosX, PosY, PosZ, 0); + a_Player.GetWorld()->BroadcastSoundParticleEffect(EffectID::SFX_RANDOM_ANVIL_USE, BlockPos, 0); } } |