From 78d08b3ac2e81414d9b98590bbf9fe898356df31 Mon Sep 17 00:00:00 2001 From: pogokeen Date: Mon, 6 May 2019 21:53:46 +0000 Subject: [PATCH] engine.cpp: fix sprite sorting/adjustment issue introduced in r7612 that caused sprites with the same y value at the end of the sorted array to not be adjusted properly git-svn-id: https://svn.eduke32.com/eduke32@7627 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/engine.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 5eeed49b3..9d1261b80 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -8533,7 +8533,7 @@ killsprite: spritesxyz[i].y = yp; } - int32_t gap, ys; + int32_t gap, y, ys; gap = 1; while (gap < spritesortcnt) gap = (gap<<1)+1; for (gap>>=1; gap>0; gap>>=1) //Sort sprite list @@ -8549,11 +8549,11 @@ killsprite: ys = spritesxyz[0].y; i = 0; for (bssize_t j=1; j<=spritesortcnt; j++) { - if (j == spritesortcnt || - spritesxyz[j].y == ys) + y = spritesxyz[j].y^(j == spritesortcnt); + if (y == ys) continue; - ys = spritesxyz[j].y; + ys = y; if (j > i+1) {