1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 09:39:43 +01:00

Add bounds check to setlinegap

This is for consistency with all other functions dealing with the latest
created text box. There are several cases in custom levels where these
functions can be called even though there are no text boxes on screen.
This commit is contained in:
Misa 2024-02-02 15:00:44 -08:00
parent 2b476bb4c1
commit 3b0757bd82

View file

@ -1508,6 +1508,12 @@ void Graphics::textboxadjust(void)
void Graphics::setlinegap(int customvalue) void Graphics::setlinegap(int customvalue)
{ {
if (!INBOUNDS_VEC(m, textboxes))
{
vlog_error("setlinegap() out-of-bounds!");
return;
}
textboxes[m].linegap = customvalue; textboxes[m].linegap = customvalue;
textboxes[m].resize(); textboxes[m].resize();
} }