supertux/sector.cpp: Make sure the boolean argument to TileMap->get_movement is used...
authorFlorian Forster <supertux@octo.it>
Mon, 22 Feb 2010 07:06:44 +0000 (07:06 +0000)
committerFlorian Forster <supertux@octo.it>
Mon, 22 Feb 2010 07:06:44 +0000 (07:06 +0000)
Also added little comments to give the argument a name.

SVN-Revision: 6387

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));
         }
       }
     }