summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemEnchantingTable.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Items/ItemEnchantingTable.h')
-rw-r--r--src/Items/ItemEnchantingTable.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/Items/ItemEnchantingTable.h b/src/Items/ItemEnchantingTable.h
index c8eb42cac..12835cb4a 100644
--- a/src/Items/ItemEnchantingTable.h
+++ b/src/Items/ItemEnchantingTable.h
@@ -46,16 +46,12 @@ private:
}
const auto PlacePos = AddFaceDirection(a_ClickedBlockPos, a_ClickedBlockFace);
- a_World.DoWithBlockEntityAt(PlacePos.x, PlacePos.y, PlacePos.z, [&a_EquippedItem](cBlockEntity & a_Entity)
+ a_World.DoWithBlockEntityAt(PlacePos, [&a_EquippedItem](cBlockEntity & a_Entity)
{
- if (a_Entity.GetBlockType() != E_BLOCK_ENCHANTMENT_TABLE)
- {
- return true;
- }
+ ASSERT(a_Entity.GetBlockType() == E_BLOCK_ENCHANTMENT_TABLE);
- auto & EnchantingTable = static_cast<cEnchantingTableEntity &>(a_Entity);
- EnchantingTable.SetCustomName(a_EquippedItem.m_CustomName);
- return true;
+ static_cast<cEnchantingTableEntity &>(a_Entity).SetCustomName(a_EquippedItem.m_CustomName);
+ return false;
});
return true;