# HG changeset patch # User rubidium # Date 1189805819 0 # Node ID b7c5cc93fb3fba6997e9debb79f2751f286741ee # Parent d0b783a8a3e2cabc2440f98a0fd888b96984069a (svn r11104) -Fix: bounding boxes also overlap when the min of a bounding box is equal to the max of another bounding box. Patch by frosch. diff -r d0b783a8a3e2 -r b7c5cc93fb3f src/viewport.cpp --- a/src/viewport.cpp Fri Sep 14 21:35:22 2007 +0000 +++ b/src/viewport.cpp Fri Sep 14 21:36:59 2007 +0000 @@ -1147,9 +1147,9 @@ /* Decide which comparator to use, based on whether the bounding * boxes overlap */ - if (ps->xmax > ps2->xmin && ps->xmin < ps2->xmax && // overlap in X? - ps->ymax > ps2->ymin && ps->ymin < ps2->ymax && // overlap in Y? - ps->zmax > ps2->zmin && ps->zmin < ps2->zmax) { // overlap in Z? + if (ps->xmax >= ps2->xmin && ps->xmin <= ps2->xmax && // overlap in X? + ps->ymax >= ps2->ymin && ps->ymin <= ps2->ymax && // overlap in Y? + ps->zmax >= ps2->zmin && ps->zmin <= ps2->zmax) { // overlap in Z? /* Use X+Y+Z as the sorting order, so sprites closer to the bottom of * the screen and with higher Z elevation, are drawn in front. * Here X,Y,Z are the coordinates of the "center of mass" of the sprite,