summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/critter.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/critter.cpp b/src/critter.cpp
index fd50c4b9..637324ec 100644
--- a/src/critter.cpp
+++ b/src/critter.cpp
@@ -187,12 +187,20 @@ void critter::update(size_t i, float dt)
offset_frac = Vector2us(Vector2(std::fabs(std::fmod(offset_[0], 1.f)), std::fabs(std::fmod(offset_[1], 1.f))) * frac);
auto off_i = Vector2i(offset_);
if (!off_i.isZero())
+ {
if (can_move_to(off_i))
{
move_to(i, off_i, new_r);
++frame %= atlas->info().nframes;
goto done;
}
+ else
+ {
+ offset_frac = {};
+ delta = 0;
+ return;
+ }
+ }
}
delta = 0;
break;