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