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.
This commit is contained in:
Misa authored and Ethan Lee committed 2020-04-26 19:07:40 -04:00
1 parent 276daa11bb
commit 4c45a8ac47
1 file changed
+2 -2
+2 -2
View File
@@ -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;