diff options
Diffstat (limited to 'src/linda.cpp')
-rw-r--r-- | src/linda.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/linda.cpp b/src/linda.cpp index a9ae61c..fa28385 100644 --- a/src/linda.cpp +++ b/src/linda.cpp | |||
@@ -1178,7 +1178,15 @@ LUAG_FUNC(linda) | |||
1178 | if (lua_isnil(L_, kIdxTop)) { | 1178 | if (lua_isnil(L_, kIdxTop)) { |
1179 | lua_pop(L_, 1); | 1179 | lua_pop(L_, 1); |
1180 | lua_pushnumber(L_, _U->lindaWakePeriod.count()); | 1180 | lua_pushnumber(L_, _U->lindaWakePeriod.count()); |
1181 | } else { | 1181 | } else if (luaG_type(L_, kIdxTop) == LuaType::STRING) { |
1182 | if (luaG_tostring(L_, kIdxTop) != "never") { | ||
1183 | luaL_argerror(L_, 1, "invalid wake_period"); | ||
1184 | } else { | ||
1185 | lua_pop(L_, 1); | ||
1186 | lua_pushnumber(L_, 0); | ||
1187 | } | ||
1188 | } | ||
1189 | else { | ||
1182 | luaL_argcheck(L_, luaL_optnumber(L_, 2, 0) > 0, 1, "wake_period must be > 0"); | 1190 | luaL_argcheck(L_, luaL_optnumber(L_, 2, 0) > 0, 1, "wake_period must be > 0"); |
1183 | } | 1191 | } |
1184 | 1192 | ||