summaryrefslogtreecommitdiffstats
path: root/src/UI/SlotArea.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2018-07-27 01:12:41 +0200
committerGitHub <noreply@github.com>2018-07-27 01:12:41 +0200
commitcdd8e425872b94878babf7823cd12381d2db1a5c (patch)
treefea666b4d4c4e10da6a957a0e403c747dbd74ef9 /src/UI/SlotArea.cpp
parentCheckBasicStyle: Check number of empty lines between functions (#4267) (diff)
downloadcuberite-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.cpp7
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);
}
}