mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-02-03 15:55:30 +03:00
Fix missing return statements in drawsprite()
Whoops. Otherwise the game would end up indexing out-of-bounds despite checking for it anyways.
This commit is contained in:
@@ -716,6 +716,7 @@ void Graphics::drawsprite( int x, int y, int t, int r, int g, int b )
|
|||||||
if (!INBOUNDS_VEC(t, sprites))
|
if (!INBOUNDS_VEC(t, sprites))
|
||||||
{
|
{
|
||||||
WHINE_ONCE("drawsprite() out-of-bounds!");
|
WHINE_ONCE("drawsprite() out-of-bounds!");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_Rect rect = {x, y, sprites_rect.w, sprites_rect.h};
|
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))
|
if (!INBOUNDS_VEC(t, sprites))
|
||||||
{
|
{
|
||||||
WHINE_ONCE("drawsprite() out-of-bounds!");
|
WHINE_ONCE("drawsprite() out-of-bounds!");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_Rect rect = {x, y, sprites_rect.w, sprites_rect.h};
|
SDL_Rect rect = {x, y, sprites_rect.w, sprites_rect.h};
|
||||||
|
|||||||
Reference in New Issue
Block a user