From 0a59779460a0111cff2a0036b1c5fdbfe1c1ad62 Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 20 Oct 2015 07:15:25 +0000 Subject: [PATCH] Sort tsprites by owner as a replacement for the sort by statnum removed by Helixhorned a while back. Seems sensible enough... git-svn-id: https://svn.eduke32.com/eduke32@5394 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/engine.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 4451fcffb..291dd2c98 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -9819,6 +9819,16 @@ killsprite: spritesxyz[k] = spritesxyz[l]; spritesxyz[l] = tv3; } + + for (int32_t k=i+1; kowner < tspriteptr[l]->owner) + { + swapptr(&tspriteptr[k], &tspriteptr[l]); + vec3_t tv3 = spritesxyz[k]; + spritesxyz[k] = spritesxyz[l]; + spritesxyz[l] = tv3; + } } i = j; }