From c591b79daff333d17435e590c0892cf38438b4ae Mon Sep 17 00:00:00 2001 From: Misa Date: Wed, 25 Aug 2021 11:12:23 -0700 Subject: [PATCH] Reset words array in hardreset() Otherwise, levels could leave stale arguments in the array, and then the behavior of another level loaded right after might end up being different because of that. --- desktop_version/src/Script.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 21d7bd59..48ce1f16 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -3565,6 +3565,10 @@ void scriptclass::hardreset(void) scriptdelay = 0; scriptname = "null"; running = false; + for (size_t ii = 0; ii < SDL_arraysize(words); ++ii) + { + words[ii] = ""; + } } void scriptclass::loadcustom(const std::string& t)