Require a non-empty argument in ShowMap (#8466)
Some checks failed
Build and test / Ubuntu (push) Has been cancelled
Build and test / MacOS (push) Has been cancelled
Build and test / Read .env file and expose it as output (push) Has been cancelled
Build and test / Windows (2019) (push) Has been cancelled
Build and test / Windows (2022) (push) Has been cancelled

This commit is contained in:
Alexei Kotov 2025-04-25 21:24:27 +03:00
parent 80d6f020ed
commit 58fcc8f66d

View file

@ -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