mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Fix undefined behavior when backspacing in script list with 0 scripts
The problem is that it would index out-of-bounds if you did this, but this UB hasn't caused an exception until my change to refactor script-related vectors by removing their separate length-trackers.
This commit is contained in:
parent
dafadf158a
commit
7b1388f85c
1 changed files with 1 additions and 1 deletions
|
@ -3596,7 +3596,7 @@ void editorinput()
|
||||||
|
|
||||||
if(!key.keymap[SDLK_BACKSPACE]) ed.deletekeyheld=0;
|
if(!key.keymap[SDLK_BACKSPACE]) ed.deletekeyheld=0;
|
||||||
|
|
||||||
if(key.keymap[SDLK_BACKSPACE] && ed.deletekeyheld==0)
|
if(key.keymap[SDLK_BACKSPACE] && ed.deletekeyheld==0 && !ed.hooklist.empty())
|
||||||
{
|
{
|
||||||
ed.deletekeyheld=1;
|
ed.deletekeyheld=1;
|
||||||
music.playef(2);
|
music.playef(2);
|
||||||
|
|
Loading…
Reference in a new issue