summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemItemFrame.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-18 00:38:25 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-18 00:38:25 +0100
commit7c0d11fbb28730a328d0cb422760cb252eb8d73f (patch)
tree4a452a11e697624ba29d0f857f8ae62af5b8dd9d /src/Items/ItemItemFrame.h
parentImplemented item frames, a part of #689 (diff)
downloadcuberite-7c0d11fbb28730a328d0cb422760cb252eb8d73f.tar
cuberite-7c0d11fbb28730a328d0cb422760cb252eb8d73f.tar.gz
cuberite-7c0d11fbb28730a328d0cb422760cb252eb8d73f.tar.bz2
cuberite-7c0d11fbb28730a328d0cb422760cb252eb8d73f.tar.lz
cuberite-7c0d11fbb28730a328d0cb422760cb252eb8d73f.tar.xz
cuberite-7c0d11fbb28730a328d0cb422760cb252eb8d73f.tar.zst
cuberite-7c0d11fbb28730a328d0cb422760cb252eb8d73f.zip
Diffstat (limited to '')
-rw-r--r--src/Items/ItemItemFrame.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/Items/ItemItemFrame.h b/src/Items/ItemItemFrame.h
index 39be48b54..a403778ad 100644
--- a/src/Items/ItemItemFrame.h
+++ b/src/Items/ItemItemFrame.h
@@ -23,23 +23,24 @@ public:
{
if (a_Dir == BLOCK_FACE_NONE)
{
+ // Client sends this if clicked on top or bottom face
return false;
}
- AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_Dir);
+ AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_Dir); // Make sure block that will be occupied is free
BLOCKTYPE Block = a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ);
- AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_Dir, true);
+ AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_Dir, true); // We want the clicked block, so go back again
if (Block == E_BLOCK_AIR)
{
int Dir = 0;
switch (a_Dir)
{
- case BLOCK_FACE_SOUTH: break;
- case BLOCK_FACE_NORTH: Dir = 2; break;
- case BLOCK_FACE_WEST: Dir = 1; break;
- case BLOCK_FACE_EAST: Dir = 3; break;
- default: return false;
+ case BLOCK_FACE_ZP: break; // Initialised to zero
+ case BLOCK_FACE_ZM: Dir = 2; break;
+ case BLOCK_FACE_XM: Dir = 1; break;
+ case BLOCK_FACE_XP: Dir = 3; break;
+ default: ASSERT(!"Unhandled block face when trying spawn item frame!"); return false;
}
cItemFrame * ItemFrame = new cItemFrame(Dir, a_BlockX, a_BlockY, a_BlockZ);