From 647d655f2e1d192b4cd32d9df3357722a2807e12 Mon Sep 17 00:00:00 2001 From: Sebastian Fieber Date: Sun, 30 Nov 2025 16:27:10 +0100 Subject: [PATCH] make it possible to remove anonymous vfx --- apps/openmw/mwlua/animationbindings.cpp | 2 -- files/lua_api/openmw/world.lua | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/openmw/mwlua/animationbindings.cpp b/apps/openmw/mwlua/animationbindings.cpp index 1da5c6b98f..3f96e2b037 100644 --- a/apps/openmw/mwlua/animationbindings.cpp +++ b/apps/openmw/mwlua/animationbindings.cpp @@ -294,8 +294,6 @@ namespace MWLua api["remove"] = [context](std::string vfxId) { context.mLuaManager->addAction( [vfxId = std::move(vfxId)] { - if (vfxId.empty()) - throw std::runtime_error("vfxId is empty"); MWBase::Environment::get().getWorld()->removeEffect(vfxId); }, "openmw.vfx.remove"); diff --git a/files/lua_api/openmw/world.lua b/files/lua_api/openmw/world.lua index 54dc01356d..e9fb319b1d 100644 --- a/files/lua_api/openmw/world.lua +++ b/files/lua_api/openmw/world.lua @@ -210,7 +210,7 @@ --- -- Remove all VFX with the given vfxId. Best invoked through the RemoveVfx global event -- @function [parent=#VFX] remove --- @param #string vfxId the vfxId of the VFX to remove. +-- @param #string vfxId the vfxId of the VFX to remove. Passing an empty string removes all VFX that don't have a vfxId -- -- @usage -- Remove all VFX with vfxId "myvfx" -- core.sendGlobalEvent('RemoveVfx', "myvfx")