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

Prevent removing line if there is only one line

This fixes another way you could end up typing on a non-existent line in
the script editor.

In a script with only 1 line, which is empty, the game would let you
press backspace on it, removing the line. This results in you typing on
a non-existent line.

You will keep typing on it until you either close the script or press
Up. If you press Up, you will be unable to get back to the non-existent
line, for it doesn't exist - but the text you typed on the non-existent
line will still be there, until you close the script and re-open it.
This commit is contained in:
Misa 2020-02-10 18:29:29 -08:00 committed by Ethan Lee
parent 172ab9195d
commit 9b125ad8df

View file

@ -546,7 +546,7 @@ void editorclass::clearscriptbuffer()
void editorclass::removeline(int t) void editorclass::removeline(int t)
{ {
//Remove line t from the script //Remove line t from the script
if(sblength>0) if(sblength>1)
{ {
if(sblength==t) if(sblength==t)
{ {
@ -5387,4 +5387,4 @@ void editorinput( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map, enti
} }
} }
#endif /* NO_CUSTOM_LEVELS */ #endif /* NO_CUSTOM_LEVELS */