1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-10-17 03:16:34 +00:00

Merge branch 'showmap' into 'master'

Require a non-empty argument in ShowMap (#8466)

Closes #8466

See merge request OpenMW/openmw!4649
This commit is contained in:
psi29a 2025-07-01 21:28:02 +00:00
commit aa3e991352

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