if(Collision::rectangle_aatriangle(temphit, dest, object->movement,
triangle)) {
hit.tileflags |= tile->getAttributes();
- if(temphit.time > hit.time) {
+ if(temphit.time > hit.time && (tile->getAttributes() & Tile::SOLID)) {
temphit.tileflags = hit.tileflags;
hit = temphit;
}
if(Collision::rectangle_rectangle(temphit, dest,
object->movement, rect)) {
hit.tileflags |= tile->getAttributes();
- if(temphit.time > hit.time) {
+ if(temphit.time > hit.time && (tile->getAttributes() & Tile::SOLID)) {
temphit.tileflags = hit.tileflags;
hit = temphit;
}
}
// did we collide at all?
- if(hit.time < 0)
+ if(hit.tileflags == 0)
return;
// call collision function