1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 20:29:57 +00:00

Fix errors

This commit is contained in:
Zackhasacat 2024-03-12 07:29:48 -05:00
parent 8b75932f50
commit 59a25291f8

View file

@ -65,7 +65,7 @@ namespace MWLua
return static_cast<float>(MWBase::Environment::get().getWorld()->getGlobalInt(globalId)); return static_cast<float>(MWBase::Environment::get().getWorld()->getGlobalInt(globalId));
} }
return 0; return 0;
}; }
sol::table initMWScriptBindings(const Context& context) sol::table initMWScriptBindings(const Context& context)
{ {
@ -146,7 +146,7 @@ namespace MWLua
return sol::nullopt; return sol::nullopt;
return getGlobalVariableValue(globalId); return getGlobalVariableValue(globalId);
}, },
[](const GlobalStore& store, int index) -> sol::optional<float> { [](const GlobalStore& store, size_t index) -> sol::optional<float> {
if (index < 1 || store.getSize() < index) if (index < 1 || store.getSize() < index)
return sol::nullopt; return sol::nullopt;
auto g = store.at(index - 1); auto g = store.at(index - 1);
@ -164,7 +164,7 @@ namespace MWLua
return getGlobalVariableValue(globalId); return getGlobalVariableValue(globalId);
}); });
globalStoreT[sol::meta_function::pairs] = [](const GlobalStore& store) { globalStoreT[sol::meta_function::pairs] = [](const GlobalStore& store) {
int index = 0; size_t index = 0;
return sol::as_function( return sol::as_function(
[index, &store](sol::this_state ts) mutable -> sol::optional<std::tuple<std::string, float>> { [index, &store](sol::this_state ts) mutable -> sol::optional<std::tuple<std::string, float>> {
if (index >= store.getSize()) if (index >= store.getSize())