From 5402b214b31af60bc96cd4e47e9211715c3e99f5 Mon Sep 17 00:00:00 2001 From: Lane Kolbly Date: Fri, 28 Jul 2017 11:59:21 -0500 Subject: Check for intersection between placed blocks and entities. (#3850) * Check for intersection between placed blocks and entities. + Implemented GetPlacementCollisionBox, to permit custom placement collision boxes for blocks. * Factored block-entity placement checking into another function in cPlayer. - Removed vector min/max functions * Use GetWorld to get the world in DoesPlacingBlocksIntersectEntity. + Added block height checks, allow different cEntity subclasses to decide whether they will prevent block placement. --- tests/LuaThreadStress/Stubs.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/LuaThreadStress') diff --git a/tests/LuaThreadStress/Stubs.cpp b/tests/LuaThreadStress/Stubs.cpp index aadb92d0b..eb46f0e0c 100644 --- a/tests/LuaThreadStress/Stubs.cpp +++ b/tests/LuaThreadStress/Stubs.cpp @@ -109,6 +109,14 @@ cBlockInfo::cBlockInfoArray::cBlockInfoArray() +cBoundingBox::cBoundingBox(double, double, double, double, double, double) +{ +} + + + + + cBlockHandler::cBlockHandler(BLOCKTYPE a_BlockType) { } @@ -117,6 +125,15 @@ cBlockHandler::cBlockHandler(BLOCKTYPE a_BlockType) +cBoundingBox cBlockHandler::GetPlacementCollisionBox(BLOCKTYPE a_XM, BLOCKTYPE a_XP, BLOCKTYPE a_YM, BLOCKTYPE a_YP, BLOCKTYPE a_ZM, BLOCKTYPE a_ZP) +{ + return cBoundingBox(0, 0, 0, 0, 0, 0); +} + + + + + bool cBlockHandler::GetPlacementBlockTypeMeta( cChunkInterface & a_ChunkInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, -- cgit v1.2.3