From 6dc5194895b6bd61d19bf5c95021471784084325 Mon Sep 17 00:00:00 2001 From: untodesu Date: Tue, 1 Jul 2025 03:23:05 +0500 Subject: I forgot to set these to true in .clang-format https://files.catbox.moe/909rig.gif --- game/shared/entity/collision.cc | 12 ++++++++---- game/shared/entity/stasis.cc | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'game/shared/entity') diff --git a/game/shared/entity/collision.cc b/game/shared/entity/collision.cc index 190f6e7..454e96a 100644 --- a/game/shared/entity/collision.cc +++ b/game/shared/entity/collision.cc @@ -49,7 +49,8 @@ static int vgrid_collide(const world::Dimension* dimension, int d, entity::Colli ddir = local_pos::value_type(+1); dmin = lpos_min[d]; dmax = lpos_max[d]; - } else { + } + else { ddir = local_pos::value_type(-1); dmin = lpos_max[d]; dmax = lpos_min[d]; @@ -115,7 +116,8 @@ static int vgrid_collide(const world::Dimension* dimension, int d, entity::Colli if(move_distance > threshold) { velocity.value[d] *= -latch_values[d]; - } else { + } + else { velocity.value[d] = 0.0f; } @@ -154,10 +156,12 @@ void entity::Collision::fixed_update(world::Dimension* dimension) if(dimension->entities.any_of(entity)) { if(vertical_move == math::sign(dimension->get_gravity())) { dimension->entities.emplace_or_replace(entity, entity::Grounded { surface }); - } else { + } + else { dimension->entities.remove(entity); } - } else { + } + else { // The entity cannot be grounded because the component // setup of said entity should not let it comprehend the // concept of resting on the ground (it flies around) diff --git a/game/shared/entity/stasis.cc b/game/shared/entity/stasis.cc index 10e2e0c..68d8e9d 100644 --- a/game/shared/entity/stasis.cc +++ b/game/shared/entity/stasis.cc @@ -12,7 +12,8 @@ void entity::Stasis::fixed_update(world::Dimension* dimension) for(auto [entity, transform] : view.each()) { if(dimension->find_chunk(transform.chunk)) { dimension->entities.remove(entity); - } else { + } + else { dimension->entities.emplace_or_replace(entity); } } -- cgit