--- a/src/PhysicsObject.cc Mon Dec 08 17:24:40 2008 +0000
+++ b/src/PhysicsObject.cc Mon Dec 08 17:27:25 2008 +0000
@@ -200,11 +200,13 @@
const Vector diffVec = newPosition - position;
const Vector unitVector = diffVec / diffVec.length();
+ if(unitVector == Vector(0, 0)) {
+ return;
+ }
Vector reached = position;
while ((position - reached).sqrLength() < diffVec.sqrLength()) {
reached += unitVector;
-
// Check if any of the shapes points collide
for (uint64_t i = 0; i < shape.size(); i++) {
if (world.collides(reached+shape[i])) { // Collision