mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-23 03:47:34 -04:00
Requested changes
This commit is contained in:
parent
4700fdcfc2
commit
86666761a3
@ -53,7 +53,7 @@ namespace sol
|
|||||||
namespace MWLua
|
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);
|
char varType = MWBase::Environment::get().getWorld()->getGlobalVariableType(globalId);
|
||||||
if (varType == 'f')
|
if (varType == 'f')
|
||||||
@ -147,7 +147,7 @@ namespace MWLua
|
|||||||
return getGlobalVariableValue(globalId);
|
return getGlobalVariableValue(globalId);
|
||||||
},
|
},
|
||||||
[](const GlobalStore& store, int index) -> sol::optional<float> {
|
[](const GlobalStore& store, int index) -> sol::optional<float> {
|
||||||
if (index < 1 || index >= store.getSize())
|
if (index < 1 || store.getSize() < index)
|
||||||
return sol::nullopt;
|
return sol::nullopt;
|
||||||
auto g = store.at(index - 1);
|
auto g = store.at(index - 1);
|
||||||
if (g == nullptr)
|
if (g == nullptr)
|
||||||
@ -170,7 +170,7 @@ namespace MWLua
|
|||||||
if (index >= store.getSize())
|
if (index >= store.getSize())
|
||||||
return sol::nullopt;
|
return sol::nullopt;
|
||||||
|
|
||||||
const auto& global = store.at(index++);
|
const ESM::Global* global = store.at(index++);
|
||||||
if (!global)
|
if (!global)
|
||||||
return sol::nullopt;
|
return sol::nullopt;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user