supertux/sector.cpp: Make sure the boolean argument to TileMap->get_movement is used...
authorflorianf <florianf@837edb03-e0f3-0310-88ca-d4d4e8b29345>
Mon, 22 Feb 2010 07:06:44 +0000 (07:06 +0000)
committerflorianf <florianf@837edb03-e0f3-0310-88ca-d4d4e8b29345>
Mon, 22 Feb 2010 07:06:44 +0000 (07:06 +0000)
Also added little comments to give the argument a name.

git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6387 837edb03-e0f3-0310-88ca-d4d4e8b29345

src/supertux/sector.cpp

index 65b0f0b..5a3aef4 100644 (file)
@@ -1271,14 +1271,16 @@ Sector::collision_tilemap(collision::Constraints* constraints,
         // above the tile before
         if(tile->getAttributes() & Tile::UNISOLID) {
           int status;
+          Vector relative_movement = movement
+            - solids->get_movement(/* actual = */ true);
 
           /* Check if the tile is solid given the current movement. This works
            * 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
+           * in quotation marks because because the slope's gradient is taken.
            * Also, this uses the movement relative to the tilemaps own movement
            * (if any).  --octo */
-          status = check_movement_unisolid (movement - solids->get_movement(true), tile);
+          status = check_movement_unisolid (relative_movement, tile);
           /* If zero is returned, the unisolid tile is non-solid. */
           if (status == 0)
             continue;
@@ -1298,9 +1300,11 @@ Sector::collision_tilemap(collision::Constraints* constraints,
             slope_data = AATriangle::vertical_flip(slope_data);
           triangle = AATriangle(tile_bbox, slope_data);
 
-          collision::rectangle_aatriangle(constraints, dest, triangle, solids->get_movement());
+          collision::rectangle_aatriangle(constraints, dest, triangle,
+              solids->get_movement(/* actual = */ false));
         } else { // normal rectangular tile
-          check_collisions(constraints, movement, dest, tile_bbox, NULL, NULL, solids->get_movement());
+          check_collisions(constraints, movement, dest, tile_bbox, NULL, NULL,
+              solids->get_movement(/* actual = */ false));
         }
       }
     }