-Weffc++ fix
[supertux.git] / src / object / tilemap.hpp
index c2b61dd..8b3939b 100644 (file)
@@ -76,9 +76,16 @@ public:
   Vector get_offset() const
   { return offset; }
 
-  const Vector& get_movement() const
+  /** Get the movement of this tilemap. The collision detection code may need a
+   *  non-negative y-movement. Passing `false' as the `actual' argument will
+   *  provide that. Used exclusively in src/supertux/sector.cpp. */
+  Vector get_movement(bool actual) const
   {
-    return movement;
+    if(actual) {
+      return movement;
+    } else {
+      return Vector(movement.x, std::max(0.0f,movement.y));
+    }
   }
 
   Path *get_path()