From 14f2a3ad5d1231d3214e17e907b1ad10cbc10c8d Mon Sep 17 00:00:00 2001 From: mohydine <> Date: Sun, 14 Mar 2004 20:54:55 +0000 Subject: [PATCH] Better draw level sorting when draw levels are equal --- src/unit/unit_draw.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/unit/unit_draw.cpp b/src/unit/unit_draw.cpp index 8ceabe4a3..75a81a767 100644 --- a/src/unit/unit_draw.cpp +++ b/src/unit/unit_draw.cpp @@ -1965,9 +1965,12 @@ local int DrawLevelCompare(const void* v1, const void* v2) { drawlevel2 = c2->Type->DrawLevel; } if (drawlevel1 == drawlevel2) { - return c1->Y * MaxMapWidth + c1->X - c2->Y * MaxMapWidth - c2->X ? - c1->Y * MaxMapWidth + c1->X - c2->Y * MaxMapWidth - c2->X : - c1->Slot - c2->Slot; + /*return (c1->Y) * MaxMapWidth + (c1->X) - (c2->Y) * MaxMapWidth - (c2->X) ? + (c1->Y) * MaxMapWidth + (c1->X) - (c2->Y) * MaxMapWidth - (c2->X) : + c1->Slot - c2->Slot; //*/ //Previous code, will be removed if new one is ok. + return (c1->Y*TileSizeY+c1->IY) - (c2->Y*TileSizeY + c2->IY) ? + (c1->Y*TileSizeY+c1->IY) - (c2->Y*TileSizeY + c2->IY) : + c1->Slot - c2->Slot; //*/ } else { return drawlevel1 <= drawlevel2 ? -1 : 1; }