From 5a99d7b245934d0b609432efb6bf87c269cc07c2 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Mon, 3 Jun 2024 18:28:51 +1000 Subject: [PATCH] fix crash with asset scripts that only manifested after MSVC update --- source/base/StarAssets.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/base/StarAssets.cpp b/source/base/StarAssets.cpp index 1519e86..68e307a 100644 --- a/source/base/StarAssets.cpp +++ b/source/base/StarAssets.cpp @@ -151,7 +151,7 @@ Assets::Assets(Settings settings, StringList assetSources) { // re-add the assets callbacks with more functions context.remove("assets"); auto callbacks = makeBaseAssetCallbacks(); - callbacks.registerCallback("add", [&newFiles](LuaEngine& engine, String const& path, LuaValue const& data) { + callbacks.registerCallback("add", [newFiles](LuaEngine& engine, String const& path, LuaValue const& data) { ByteArray bytes; if (auto str = engine.luaMaybeTo(data)) bytes = ByteArray(str->utf8Ptr(), str->utf8Size()); @@ -165,7 +165,7 @@ Assets::Assets(Settings settings, StringList assetSources) { newFiles->set(path, bytes); }); - callbacks.registerCallback("patch", [this, &newFiles](String const& path, String const& patchPath) -> bool { + callbacks.registerCallback("patch", [this, newFiles](String const& path, String const& patchPath) -> bool { if (auto file = m_files.ptr(path)) { if (newFiles->contains(patchPath)) { file->patchSources.append(make_pair(patchPath, newFiles));