From: florianf 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=1d3bb1492dc8f56078f300e7f00348fb0e31e805;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. git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6387 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- 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)); } } }