mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 09:28:15 +03:00
Fix using speak/speak_active without a text beforehand
Otherwise, it would end up indexing a vector out-of-bounds, which is UB
and causes a segfault, too. This is used in some constructs like
say(-1)
<internal command>
where the text contents don't matter, only that a text box shows up.
This commit is contained in:
@@ -577,6 +577,10 @@ void scriptclass::run()
|
||||
{
|
||||
//Ok, actually display the textbox we've initilised now!
|
||||
//If using "speak", don't make the textbox active (so we can use multiple textboxes)
|
||||
if (txt.empty())
|
||||
{
|
||||
txt.resize(1);
|
||||
}
|
||||
graphics.createtextbox(txt[0], textx, texty, r, g, b);
|
||||
if ((int) txt.size() > 1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user