aboutsummaryrefslogtreecommitdiff
path: root/src/universe.cpp
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2025-04-18 10:26:19 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2025-04-18 10:26:19 +0200
commit022e40cc71beda874d0bad2cec227e472d5dd4af (patch)
tree7f0e03815217dd2e329a2ade1ed346247d5db884 /src/universe.cpp
parent1bff784b474261212a996ac9fc59389d53a69590 (diff)
downloadlanes-022e40cc71beda874d0bad2cec227e472d5dd4af.tar.gz
lanes-022e40cc71beda874d0bad2cec227e472d5dd4af.tar.bz2
lanes-022e40cc71beda874d0bad2cec227e472d5dd4af.zip
New feature: Linda periodical cancellation checks
* lanes.linda() api change: takes all settings in a single table argument * new linda creation argument wake_period * new lanes.configure setting linda_wake_period * adjusted all unit tests (one TODO test fails on purpose)
Diffstat (limited to 'src/universe.cpp')
-rw-r--r--src/universe.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/universe.cpp b/src/universe.cpp
index 89ad02a..335f056 100644
--- a/src/universe.cpp
+++ b/src/universe.cpp
@@ -153,6 +153,14 @@ Universe* Universe::Create(lua_State* const L_)
153 lua_setmetatable(L_, -2); // L_: settings universe 153 lua_setmetatable(L_, -2); // L_: settings universe
154 lua_pop(L_, 1); // L_: settings 154 lua_pop(L_, 1); // L_: settings
155 155
156 std::ignore = luaG_getfield(L_, kIdxSettings, "linda_wake_period"); // L_: settings linda_wake_period
157 if (luaG_type(L_, kIdxTop) == LuaType::NUMBER) {
158 _U->lindaWakePeriod = lua_Duration{ lua_tonumber(L_, kIdxTop) };
159 } else {
160 LUA_ASSERT(L_, luaG_tostring(L_, kIdxTop) == "never");
161 }
162 lua_pop(L_, 1); // L_: settings
163
156 std::ignore = luaG_getfield(L_, kIdxSettings, "strip_functions"); // L_: settings strip_functions 164 std::ignore = luaG_getfield(L_, kIdxSettings, "strip_functions"); // L_: settings strip_functions
157 _U->stripFunctions = lua_toboolean(L_, -1) ? true : false; 165 _U->stripFunctions = lua_toboolean(L_, -1) ? true : false;
158 lua_pop(L_, 1); // L_: settings 166 lua_pop(L_, 1); // L_: settings