diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-05-20 10:58:06 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-05-20 10:58:06 +0200 |
commit | 08040747494fe7839d2ab049e37f8e23fb8141b4 (patch) | |
tree | 62dbbc9227d61e7447ad66e377b5c544c3bf118d /src/uniquekey.h | |
parent | 742cfdd2f9009ed12d7109e152df8c760851a58a (diff) | |
download | lanes-08040747494fe7839d2ab049e37f8e23fb8141b4.tar.gz lanes-08040747494fe7839d2ab049e37f8e23fb8141b4.tar.bz2 lanes-08040747494fe7839d2ab049e37f8e23fb8141b4.zip |
linda:limit errors on limits < 1
Diffstat (limited to 'src/uniquekey.h')
-rw-r--r-- | src/uniquekey.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/uniquekey.h b/src/uniquekey.h index 6265a56..67b3279 100644 --- a/src/uniquekey.h +++ b/src/uniquekey.h | |||
@@ -107,6 +107,23 @@ class RegistryUniqueKey | |||
107 | STACK_CHECK(L_, 1); | 107 | STACK_CHECK(L_, 1); |
108 | return false; | 108 | return false; |
109 | } | 109 | } |
110 | // --------------------------------------------------------------------------------------------- | ||
111 | void getSubTableMode(lua_State* L_, const char* mode_) const | ||
112 | { | ||
113 | STACK_CHECK_START_REL(L_, 0); | ||
114 | if (!getSubTable(L_, 0, 0)) { // L_: {} | ||
115 | // Set its metatable if requested | ||
116 | if (mode_) { | ||
117 | STACK_GROW(L_, 3); | ||
118 | lua_createtable(L_, 0, 1); // L_: {} mt | ||
119 | lua_pushliteral(L_, "__mode"); // L_: {} mt "__mode" | ||
120 | lua_pushstring(L_, mode_); // L_: {} mt "__mode" mode | ||
121 | lua_rawset(L_, -3); // L_: {} mt | ||
122 | lua_setmetatable(L_, -2); // L_: {} | ||
123 | } | ||
124 | } | ||
125 | STACK_CHECK(L_, 1); | ||
126 | } | ||
110 | }; | 127 | }; |
111 | 128 | ||
112 | // ################################################################################################# | 129 | // ################################################################################################# |