summaryrefslogtreecommitdiffstats
path: root/game/shared/entity/collision.cc
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-07-01 03:23:05 +0500
committeruntodesu <kirill@untode.su>2025-07-01 03:23:05 +0500
commit6dc5194895b6bd61d19bf5c95021471784084325 (patch)
tree705c35b3a671a09fc52b406dca81e7761729ded6 /game/shared/entity/collision.cc
parent44d91043f268d93dd08e99c5855bd29f85dd61a7 (diff)
downloadvoxelius-6dc5194895b6bd61d19bf5c95021471784084325.tar.bz2
voxelius-6dc5194895b6bd61d19bf5c95021471784084325.zip
I forgot to set these to true in .clang-format
https://files.catbox.moe/909rig.gif
Diffstat (limited to 'game/shared/entity/collision.cc')
-rw-r--r--game/shared/entity/collision.cc12
1 files changed, 8 insertions, 4 deletions
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::Gravity>(entity)) {
if(vertical_move == math::sign<int>(dimension->get_gravity())) {
dimension->entities.emplace_or_replace<entity::Grounded>(entity, entity::Grounded { surface });
- } else {
+ }
+ else {
dimension->entities.remove<entity::Grounded>(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)