X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fsector.cpp;h=f0463d80a2bcd4013f726efcd0ef87c151e7d675;hb=20a94a721fdee25587d1698ff8cfd6d014b590f1;hp=295c57dbb1f05a938beb7387487ec962dfa874a9;hpb=13c6f377301f91c8d79ab768ba97b5eb771ed624;p=supertux.git diff --git a/src/sector.cpp b/src/sector.cpp index 295c57dbb..f0463d80a 100644 --- a/src/sector.cpp +++ b/src/sector.cpp @@ -710,7 +710,7 @@ Sector::try_unexpose(GameObject* object) ScriptInterface* interface = dynamic_cast (object); if(interface != NULL) { HSQUIRRELVM vm = Scripting::global_vm; - int oldtop = sq_gettop(vm); + SQInteger oldtop = sq_gettop(vm); sq_pushobject(vm, sector_table); try { interface->unexpose(vm, -1); @@ -787,7 +787,7 @@ Sector::collision_tilemap(const Rect& dest, const Vector& movement, // only handle unisolid when the player is falling down and when he was // above the tile before if(tile->getAttributes() & Tile::UNISOLID) { - if(movement.y < 0 || dest.get_top() - movement.y > y*32) + if(movement.y <= 0 || dest.get_top() - movement.y > y*32) continue; } @@ -818,31 +818,6 @@ Sector::collision_tilemap(const Rect& dest, const Vector& movement, uint32_t Sector::collision_tile_attributes(const Rect& dest) const { - /** XXX This function doesn't work correctly as it will check all tiles - * in the bounding box of the object movement, this might include tiles - * that have actually never been touched by the object - * (though this only occures for very fast objects...) - */ - -#if 0 - // calculate rectangle where the object will move - float x1, x2; - if(object->get_movement().x >= 0) { - x1 = object->get_bbox().p1.x; - x2 = object->get_bbox().p2.x + object->get_movement().x; - } else { - x1 = object->get_bbox().p1.x + object->get_movement().x; - x2 = object->get_bbox().p2.x; - } - float y1, y2; - if(object->get_movement().y >= 0) { - y1 = object->get_bbox().p1.y; - y2 = object->get_bbox().p2.y + object->get_movement().y; - } else { - y1 = object->get_bbox().p1.y + object->get_movement().y; - y2 = object->get_bbox().p2.y; - } -#endif float x1 = dest.p1.x; float y1 = dest.p1.y; float x2 = dest.p2.x;