throw if vfxId is empty

This commit is contained in:
Sebastian Fieber 2025-07-29 23:06:36 +02:00
parent c75121e6ec
commit 2ad54439da

View File

@ -303,7 +303,8 @@ namespace MWLua
api["remove"] = [context](std::string vfxId) { api["remove"] = [context](std::string vfxId) {
context.mLuaManager->addAction( context.mLuaManager->addAction(
[vfxId = vfxId] { [vfxId = vfxId] {
if (!vfxId.empty()) if (vfxId.empty())
throw std::runtime_error("vfxId is empty");
MWBase::Environment::get().getWorld()->removeEffect(vfxId); MWBase::Environment::get().getWorld()->removeEffect(vfxId);
}, },
"openmw.vfx.remove"); "openmw.vfx.remove");