From bdfef59084e5bdd51068c8533799671bdc24c192 Mon Sep 17 00:00:00 2001 From: "Valeriano A.R" Date: Sun, 3 Oct 2021 20:44:23 +0200 Subject: [PATCH] GameLib: Sort entitites horizontally --- src/GameLib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/GameLib.c b/src/GameLib.c index bb85d63..afd9d72 100644 --- a/src/GameLib.c +++ b/src/GameLib.c @@ -311,7 +311,11 @@ void GameLib_ProcLoop(void *data) { // Same level float y1 = ent1->pos[1] + ent1->sortYOffset; float y2 = ent2->pos[1] + ent2->sortYOffset; - if (y1 > y2) { + if (y1 == y2) { + if(ent1->pos[0] < ent2->pos[0]){ + swap = 1; + } + } else if (y1 > y2) { swap = 1; } }