From 86666761a3c037b399ae1b6e522863f444184d06 Mon Sep 17 00:00:00 2001 From: Zackhasacat Date: Thu, 8 Feb 2024 21:51:54 -0600 Subject: [PATCH] Requested changes --- apps/openmw/mwlua/mwscriptbindings.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwlua/mwscriptbindings.cpp b/apps/openmw/mwlua/mwscriptbindings.cpp index ded00dc2b2..c04339f28a 100644 --- a/apps/openmw/mwlua/mwscriptbindings.cpp +++ b/apps/openmw/mwlua/mwscriptbindings.cpp @@ -53,7 +53,7 @@ namespace sol namespace MWLua { - auto getGlobalVariableValue(const std::string_view globalId) -> float + float getGlobalVariableValue(const std::string_view globalId) { char varType = MWBase::Environment::get().getWorld()->getGlobalVariableType(globalId); if (varType == 'f') @@ -147,7 +147,7 @@ namespace MWLua return getGlobalVariableValue(globalId); }, [](const GlobalStore& store, int index) -> sol::optional { - if (index < 1 || index >= store.getSize()) + if (index < 1 || store.getSize() < index) return sol::nullopt; auto g = store.at(index - 1); if (g == nullptr) @@ -170,7 +170,7 @@ namespace MWLua if (index >= store.getSize()) return sol::nullopt; - const auto& global = store.at(index++); + const ESM::Global* global = store.at(index++); if (!global) return sol::nullopt;