From 7562a79fa214245544cb379423314c3a0766a7f2 Mon Sep 17 00:00:00 2001 From: Mel Date: Mon, 14 Aug 2023 03:40:10 +0200 Subject: Generate AABBs for terrain that collides with Player --- src/World/Generation/Decoration.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/World/Generation/Decoration.cpp') diff --git a/src/World/Generation/Decoration.cpp b/src/World/Generation/Decoration.cpp index 556b5e7..0623c05 100644 --- a/src/World/Generation/Decoration.cpp +++ b/src/World/Generation/Decoration.cpp @@ -4,11 +4,11 @@ namespace MC::World::Generation { void Decorator::put_block(Chunk& chunk, Pos pos, BlockType block) { - if (!Chunk::is_valid_position(pos.x(), pos.y(), pos.z())) { + if (!Chunk::is_valid_position(pos)) { return; } - auto& place = chunk.at(pos.x(), pos.y(), pos.z()); + auto& place = chunk.at(pos); if (place.empty()) { place = {block}; } @@ -88,7 +88,7 @@ void TreeDecorator::draw_tree(Chunk& chunk, Pos pos) const { } } -Bool TreeDecorator::is_valid_position(Vector<3, UInt> pos) { +Bool TreeDecorator::is_valid_position(Pos pos) { Int tree_radius = s_tree_radius; return (Int)pos.x() - tree_radius >= 0 && pos.x() + tree_radius <= Chunk::Width -- cgit 1.4.1