From 1126f38a1e7c6b08cf8777ffdcad0c29c0023653 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Fri, 23 Feb 2024 17:02:40 +0400 Subject: [PATCH] Do not copy the whole attributes store --- apps/openmw/mwlua/stats.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwlua/stats.cpp b/apps/openmw/mwlua/stats.cpp index c6492c1ec2..eaa1f89d97 100644 --- a/apps/openmw/mwlua/stats.cpp +++ b/apps/openmw/mwlua/stats.cpp @@ -476,7 +476,7 @@ namespace MWLua auto skillIncreasesForAttributeStatsT = context.mLua->sol().new_usertype("SkillIncreasesForAttributeStats"); - for (auto attribute : MWBase::Environment::get().getESMStore()->get()) + for (const auto& attribute : MWBase::Environment::get().getESMStore()->get()) { skillIncreasesForAttributeStatsT[ESM::RefId(attribute.mId).serializeText()] = sol::property( [=](const SkillIncreasesForAttributeStats& stat) { return stat.get(context, attribute.mId); },