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

Fix typing pipes in save/load prompts in editor

13d6b2d64c adds a check where you can't
type a pipe in script/terminal input fields anymore. It does this
completely incorrectly, checking if certain variables are set instead
of checking what's actually trying to be done.

This commit fixes that, simplifying the check a lot in the process.
This commit is contained in:
AllyTally 2024-01-10 12:15:10 -04:00 committed by Misa Elizabeth Kai
parent 48a71f4c22
commit 23915e0d22

View file

@ -3472,10 +3472,9 @@ void editorinput(void)
case EditorSubState_DRAW_INPUT: case EditorSubState_DRAW_INPUT:
// We're taking input! // We're taking input!
if (INBOUNDS_VEC(ed.text_entity, customentities) if (ed.current_text_mode == TEXT_SCRIPT)
&& (customentities[ed.text_entity].t == 18 || customentities[ed.text_entity].t == 19))
{ {
// This is a terminal or script box, so this is a script name. // This is editing an entity's text field, currently only used as a script name.
// Remove all pipes, they are the line separator in the XML. // Remove all pipes, they are the line separator in the XML.
// When this loop reaches the end, it wraps to SIZE_MAX; SIZE_MAX + 1 is 0 // When this loop reaches the end, it wraps to SIZE_MAX; SIZE_MAX + 1 is 0
for (size_t i = key.keybuffer.length() - 1; i + 1 > 0; i--) for (size_t i = key.keybuffer.length() - 1; i + 1 > 0; i--)