diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-06-03 18:28:51 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-06-03 18:28:51 +1000 |
commit | 5a99d7b245934d0b609432efb6bf87c269cc07c2 (patch) | |
tree | 1f3b01b7e5c7c81f573e49b2f65e19480154555a /source/base | |
parent | 5d1e85b24154dea8ccf0fc98e54a5c0cbf32453c (diff) |
fix crash with asset scripts that only manifested after MSVC update
Diffstat (limited to 'source/base')
-rw-r--r-- | source/base/StarAssets.cpp | 4 |
1 files 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<String>(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)); |