From: Florian Forster Date: Mon, 22 Feb 2010 07:06:44 +0000 (+0000) Subject: supertux/sector.cpp: Make sure the boolean argument to TileMap->get_movement is used... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=5208dfd7712323660403102db9c9d85d7e4b0386;p=supertux.git supertux/sector.cpp: Make sure the boolean argument to TileMap->get_movement is used everywhere. Also added little comments to give the argument a name. SVN-Revision: 6387 --- diff --git a/src/supertux/sector.cpp b/src/supertux/sector.cpp index 65b0f0b80..5a3aef4c2 100644 --- a/src/supertux/sector.cpp +++ b/src/supertux/sector.cpp @@ -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)); } } }