remove world vfx only if vfxId is not empty

This commit is contained in:
Sebastian Fieber 2025-07-28 19:37:34 +02:00
parent 9a7fefb2dd
commit c75121e6ec

View File

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