X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fparticlesystem_interactive.cpp;h=de9038aba32d7aa233db4c27f0d6768448ac1136;hb=ae7bd4f460fdd93934fc0abc9589758a49309bda;hp=2d4a3c2ee1104fbcea21038995416dab069d71c0;hpb=959f514b78262ae6b276821bc61864fa6967b97c;p=supertux.git diff --git a/src/object/particlesystem_interactive.cpp b/src/object/particlesystem_interactive.cpp index 2d4a3c2ee..de9038aba 100644 --- a/src/object/particlesystem_interactive.cpp +++ b/src/object/particlesystem_interactive.cpp @@ -99,31 +99,31 @@ ParticleSystem_Interactive::collision(Particle* object, Vector movement) TileMap* solids = *i; for(int x = starttilex; x*32 < max_x; ++x) { for(int y = starttiley; y*32 < max_y; ++y) { - const Tile* tile = solids->get_tile(x, y); - if(!tile) - continue; - // skip non-solid tiles, except water - if(! (tile->getAttributes() & (Tile::WATER | Tile::SOLID))) - continue; - - if(tile->getAttributes() & Tile::SLOPE) { // slope tile - AATriangle triangle; - Vector p1(x*32, y*32); - Vector p2((x+1)*32, (y+1)*32); - triangle = AATriangle(p1, p2, tile->getData()); - - if(rectangle_aatriangle(&constraints, dest, triangle)) { - if(tile->getAttributes() & Tile::WATER) - water = true; - } - } else { // normal rectangular tile - Rect rect(x*32, y*32, (x+1)*32, (y+1)*32); - if(intersects(dest, rect)) { - if(tile->getAttributes() & Tile::WATER) - water = true; - set_rectangle_rectangle_constraints(&constraints, dest, rect); - } - } + const Tile* tile = solids->get_tile(x, y); + if(!tile) + continue; + // skip non-solid tiles, except water + if(! (tile->getAttributes() & (Tile::WATER | Tile::SOLID))) + continue; + + if(tile->getAttributes() & Tile::SLOPE) { // slope tile + AATriangle triangle; + Vector p1(x*32, y*32); + Vector p2((x+1)*32, (y+1)*32); + triangle = AATriangle(p1, p2, tile->getData()); + + if(rectangle_aatriangle(&constraints, dest, triangle)) { + if(tile->getAttributes() & Tile::WATER) + water = true; + } + } else { // normal rectangular tile + Rect rect(x*32, y*32, (x+1)*32, (y+1)*32); + if(intersects(dest, rect)) { + if(tile->getAttributes() & Tile::WATER) + water = true; + set_rectangle_rectangle_constraints(&constraints, dest, rect); + } + } } } }