diff --git a/Minecraft.World/TrapDoorTile.cpp b/Minecraft.World/TrapDoorTile.cpp index da856b920..71dbcf070 100644 --- a/Minecraft.World/TrapDoorTile.cpp +++ b/Minecraft.World/TrapDoorTile.cpp @@ -50,6 +50,7 @@ AABB *TrapDoorTile::getTileAABB(Level *level, int x, int y, int z) AABB *TrapDoorTile::getAABB(Level *level, int x, int y, int z) { + updateShape(level, x, y, z); int data = level->getData(x, y, z); if (isOpen(data)) { @@ -63,17 +64,18 @@ AABB *TrapDoorTile::getAABB(Level *level, int x, int y, int z) if (level->getTile(x, y - 1, z) == Tile::ladder_Id && attachesTo(level->getTile(xt, y, zt))) { - float r = 2 / 16.0f; // From LadderTile + float r = 2 / 16.0f; // Using only newTemp from AABB to just manipulate collision to our liking + // I tried looking at AABB.cpp more but couldn't find any helper methods to make this more readable. + // Though, I can just make new helpers but kinda scared because its not within the contributing scope. + // SO IF ITS NOT ALLOWED, GOODLUCK UNDERSTANDING. if (dir == 0) return AABB::newTemp(x, y, z + 1 - r, x + 1, y + 1, z + 1); if (dir == 1) return AABB::newTemp(x, y, z, x + 1, y + 1, z + r); if (dir == 2) return AABB::newTemp(x + 1 - r, y, z, x + 1, y + 1, z + 1); if (dir == 3) return AABB::newTemp(x, y, z, x + r, y + 1, z + 1); } } - // Default behaviour - updateShape(level, x, y, z); return Tile::getAABB(level, x, y, z); }