summaryrefslogtreecommitdiffstats
path: root/src/UI/SlotArea.cpp
diff options
context:
space:
mode:
authorhle0 <91701075+hle0@users.noreply.github.com>2024-11-08 00:05:47 +0100
committerGitHub <noreply@github.com>2024-11-08 00:05:47 +0100
commit33b9c5dc6dae42fb6fc33283ded888a8001e5394 (patch)
tree136bb3e02c25e49feb00a06857e4145a54b6c339 /src/UI/SlotArea.cpp
parentRemove simple template-id from constructors for Vector3 template. (#5586) (diff)
downloadcuberite-33b9c5dc6dae42fb6fc33283ded888a8001e5394.tar
cuberite-33b9c5dc6dae42fb6fc33283ded888a8001e5394.tar.gz
cuberite-33b9c5dc6dae42fb6fc33283ded888a8001e5394.tar.bz2
cuberite-33b9c5dc6dae42fb6fc33283ded888a8001e5394.tar.lz
cuberite-33b9c5dc6dae42fb6fc33283ded888a8001e5394.tar.xz
cuberite-33b9c5dc6dae42fb6fc33283ded888a8001e5394.tar.zst
cuberite-33b9c5dc6dae42fb6fc33283ded888a8001e5394.zip
Diffstat (limited to 'src/UI/SlotArea.cpp')
-rw-r--r--src/UI/SlotArea.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp
index 4085dc816..ef5f7382e 100644
--- a/src/UI/SlotArea.cpp
+++ b/src/UI/SlotArea.cpp
@@ -1065,9 +1065,12 @@ void cSlotAreaAnvil::OnTakeResult(cPlayer & a_Player)
BLOCKTYPE Block;
NIBBLETYPE BlockMeta;
- a_Player.GetWorld()->GetBlockTypeMeta(BlockPos, Block, BlockMeta);
- if (!a_Player.IsGameModeCreative() && (Block == E_BLOCK_ANVIL) && GetRandomProvider().RandBool(0.12))
+ if (
+ a_Player.GetWorld()->GetBlockTypeMeta(BlockPos, Block, BlockMeta) &&
+ !a_Player.IsGameModeCreative() && (Block == E_BLOCK_ANVIL) &&
+ GetRandomProvider().RandBool(0.12)
+ )
{
NIBBLETYPE Orientation = BlockMeta & 0x3;
NIBBLETYPE AnvilDamage = BlockMeta >> 2;