From 4c45a8ac476cb5067b2be01478627cedac0cb3e3 Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 26 Apr 2020 11:17:53 -0700 Subject: [PATCH] Prevent double-rendering of warping sprites on left and top of screen Previously, the game could end up rendering a warping sprite twice due to the fact that it could run "if entity is on the right side of the screen" right after "if entity is on the left side of the screen" (but not the other way around). This is most noticeable if you have a custom player sprite with translucent pixels and stand on the left side of a warping screen, but the code suggests it happens when warping through the top of the screen, too. --- desktop_version/src/Graphics.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index 1c241cfe..c9b708cc 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -1449,7 +1449,7 @@ void Graphics::drawentities() drawRect.y += tpoint.y; BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct); } - if (tpoint.x > 300) + else if (tpoint.x > 300) { tpoint.x -= 320; drawRect = sprites_rect; @@ -1468,7 +1468,7 @@ void Graphics::drawentities() drawRect.y += tpoint.y; BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct); } - if (tpoint.y > 210) + else if (tpoint.y > 210) { tpoint.y -= 230; drawRect = sprites_rect;