From bcd05b1c6328419c8b90278729f8b649494a40f0 Mon Sep 17 00:00:00 2001 From: RedEnchilada Date: Sun, 21 Feb 2016 23:02:09 -0600 Subject: [PATCH] Also fixed it for MD2s --- src/hardware/hw_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index d6268320..529c2603 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4520,11 +4520,10 @@ static void HWR_SortVisSprites(void) gr_vsprsortedhead.next = gr_vsprsortedhead.prev = &gr_vsprsortedhead; for (i = 0; i < gr_visspritecount; i++) { - bestdist = ZCLIP_PLANE-1; - bestdispoffset = INT32_MAX; + best = NULL; for (ds = unsorted.next; ds != &unsorted; ds = ds->next) { - if (ds->tz > bestdist) + if (!best || ds->tz > bestdist) { bestdist = ds->tz; bestdispoffset = ds->dispoffset;