From: Florian Forster Date: Sun, 31 Jan 2010 22:50:40 +0000 (+0000) Subject: Bug 571: Take tilemap movement into account when handling unisolid tiles for collisio... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=378447cea0cae6d79ad3ea2810d55fc67355eebd;p=supertux.git Bug 571: Take tilemap movement into account when handling unisolid tiles for collision detection. As Mathnerd314 has pointed out on IRC, checking (movement.y >= 0) is not correct when the tilemap containing the unisolid tile is moving. In this case, the relative speed should be considered. Resolves #571. SVN-Revision: 6303 --- diff --git a/src/supertux/sector.cpp b/src/supertux/sector.cpp index a4f4c4792..611f36d86 100644 --- a/src/supertux/sector.cpp +++ b/src/supertux/sector.cpp @@ -1279,9 +1279,9 @@ Sector::collision_tilemap(collision::Constraints* constraints, * for south-slopes (which are solid when moving "down") and * north-slopes (which are solid when moving "up". "up" and "down" is * in quotation marks because because the slope's gradient is taken - * into account. This is more complex than just checking for (y > 0). - * --octo */ - status = check_movement_unisolid (movement, tile); + * Also, this uses the movement relative to the tilemaps own movement + * (if any). --octo */ + status = check_movement_unisolid (movement - solids->get_movement (), tile); /* If zero is returned, the unisolid tile is non-solid. */ if (status == 0) continue;