From f33495782c4b02b30758428bdbd7b0b414c39945 Mon Sep 17 00:00:00 2001 From: florianf Date: Sun, 31 Jan 2010 22:50:40 +0000 Subject: [PATCH] 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. git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6303 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- src/supertux/sector.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 2.11.0