From 58fcc8f66d36abe6a4bd9031bad78d5da5e075ab Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Fri, 25 Apr 2025 21:24:27 +0300 Subject: [PATCH] Require a non-empty argument in ShowMap (#8466) --- apps/openmw/mwscript/guiextensions.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/openmw/mwscript/guiextensions.cpp b/apps/openmw/mwscript/guiextensions.cpp index 07855f18ef..3f84362c34 100644 --- a/apps/openmw/mwscript/guiextensions.cpp +++ b/apps/openmw/mwscript/guiextensions.cpp @@ -115,6 +115,11 @@ namespace MWScript std::string_view cell = runtime.getStringLiteral(runtime[0].mInteger); runtime.pop(); + // In Morrowind, using an empty string either errors out (e.g. console) or kills the game + // so it should be reasonable to interrupt the script + if (cell.empty()) + throw std::runtime_error("ShowMap substring must not be empty"); + // "Will match complete or partial cells, so ShowMap, "Vivec" will show cells Vivec and Vivec, Fred's // House as well." http://www.uesp.net/wiki/Tes3Mod:ShowMap