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
1 changed files with 6 additions and 0 deletions

View File

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