From 9524906768a7d0e70d4b6e7516d50e4a67a0bfad Mon Sep 17 00:00:00 2001 From: Sebastian Fieber Date: Sat, 8 Nov 2025 18:38:50 +0100 Subject: [PATCH] don't unecessarily copy vfxId --- apps/openmw/mwlua/animationbindings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwlua/animationbindings.cpp b/apps/openmw/mwlua/animationbindings.cpp index 596f43816f..1da5c6b98f 100644 --- a/apps/openmw/mwlua/animationbindings.cpp +++ b/apps/openmw/mwlua/animationbindings.cpp @@ -293,7 +293,7 @@ namespace MWLua api["remove"] = [context](std::string vfxId) { context.mLuaManager->addAction( - [vfxId = vfxId] { + [vfxId = std::move(vfxId)] { if (vfxId.empty()) throw std::runtime_error("vfxId is empty"); MWBase::Environment::get().getWorld()->removeEffect(vfxId); @@ -313,7 +313,7 @@ namespace MWLua bool useAmbientLight = options->get_or("useAmbientLight", true); context.mLuaManager->addAction( [model = VFS::Path::Normalized(model), texture = std::move(texture), worldPos, scale, - magicVfx, useAmbientLight, vfxId, loop]() { + magicVfx, useAmbientLight, vfxId = std::move(vfxId), loop]() { MWBase::Environment::get().getWorld()->spawnEffect( model, texture, worldPos, scale, magicVfx, useAmbientLight, vfxId, loop); },