From 8956b04d672b27bba6aa7e273390f4644f15b6ff Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 18 Apr 2021 10:43:36 -0700 Subject: [PATCH] Fix missing return statements in drawsprite() Whoops. Otherwise the game would end up indexing out-of-bounds despite checking for it anyways. --- desktop_version/src/Graphics.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index f2933c90..fda3009e 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -716,6 +716,7 @@ void Graphics::drawsprite( int x, int y, int t, int r, int g, int b ) if (!INBOUNDS_VEC(t, sprites)) { WHINE_ONCE("drawsprite() out-of-bounds!"); + return; } SDL_Rect rect = {x, y, sprites_rect.w, sprites_rect.h}; @@ -728,6 +729,7 @@ void Graphics::drawsprite(int x, int y, int t, Uint32 c) if (!INBOUNDS_VEC(t, sprites)) { WHINE_ONCE("drawsprite() out-of-bounds!"); + return; } SDL_Rect rect = {x, y, sprites_rect.w, sprites_rect.h};