diff options
Diffstat (limited to 'src/universe.cpp')
| -rw-r--r-- | src/universe.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/universe.cpp b/src/universe.cpp index 4db036b..934db2c 100644 --- a/src/universe.cpp +++ b/src/universe.cpp | |||
| @@ -163,6 +163,22 @@ Universe* Universe::Create(lua_State* const L_) | |||
| 163 | lua_setmetatable(L_, -2); // L_: settings universe | 163 | lua_setmetatable(L_, -2); // L_: settings universe |
| 164 | lua_pop(L_, 1); // L_: settings | 164 | lua_pop(L_, 1); // L_: settings |
| 165 | 165 | ||
| 166 | std::ignore = luaW_getfield(L_, kIdxSettings, "convert_fallback"); // L_: settings convert_fallback | ||
| 167 | if (kNilSentinel.equals(L_, kIdxTop)) { | ||
| 168 | _U->convertMode = ConvertMode::ConvertToNil; | ||
| 169 | } else if (luaW_type(L_, kIdxTop) == LuaType::STRING) { | ||
| 170 | LUA_ASSERT(L_, luaW_tostring(L_, kIdxTop) == "decay"); | ||
| 171 | _U->convertMode = ConvertMode::Decay; | ||
| 172 | } else { | ||
| 173 | LUA_ASSERT(L_, lua_isnil(L_, kIdxTop)); | ||
| 174 | } | ||
| 175 | lua_pop(L_, 1); // L_: settings | ||
| 176 | |||
| 177 | std::ignore = luaW_getfield(L_, kIdxSettings, "convert_max_attempts"); // L_: settings convert_max_attempts | ||
| 178 | _U->convertMaxAttempts = static_cast<decltype(_U->convertMaxAttempts)>(lua_tointeger(L_, kIdxTop)); | ||
| 179 | lua_pop(L_, 1); // L_: settings | ||
| 180 | STACK_CHECK(L_, 0); | ||
| 181 | |||
| 166 | std::ignore = luaW_getfield(L_, kIdxSettings, "linda_wake_period"); // L_: settings linda_wake_period | 182 | std::ignore = luaW_getfield(L_, kIdxSettings, "linda_wake_period"); // L_: settings linda_wake_period |
| 167 | if (luaW_type(L_, kIdxTop) == LuaType::NUMBER) { | 183 | if (luaW_type(L_, kIdxTop) == LuaType::NUMBER) { |
| 168 | _U->lindaWakePeriod = lua_Duration{ lua_tonumber(L_, kIdxTop) }; | 184 | _U->lindaWakePeriod = lua_Duration{ lua_tonumber(L_, kIdxTop) }; |
