diff options
| author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-19 09:15:58 +0200 |
|---|---|---|
| committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-19 09:15:58 +0200 |
| commit | ad7a8a8a8f9f762ce9952e0e2cea98e73ac2b32e (patch) | |
| tree | 6625a5bc16cde82429687a480eaf6fac224cb64d /src/keeper.cpp | |
| parent | 271ce5cff2b5e9c1e4d4f236c731ceb263716681 (diff) | |
| download | lanes-ad7a8a8a8f9f762ce9952e0e2cea98e73ac2b32e.tar.gz lanes-ad7a8a8a8f9f762ce9952e0e2cea98e73ac2b32e.tar.bz2 lanes-ad7a8a8a8f9f762ce9952e0e2cea98e73ac2b32e.zip | |
Improved on_state_create implementation
* modernized implementation uses a std::variant
* detect Lua functions with upvalues earlier
Diffstat (limited to 'src/keeper.cpp')
| -rw-r--r-- | src/keeper.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/keeper.cpp b/src/keeper.cpp index 11f1797..cdbfac9 100644 --- a/src/keeper.cpp +++ b/src/keeper.cpp | |||
| @@ -876,7 +876,7 @@ void Keepers::initialize(Universe& U_, lua_State* L_, int const nbKeepers_, int | |||
| 876 | // attempt to call on_state_create(), if we have one and it is a C function | 876 | // attempt to call on_state_create(), if we have one and it is a C function |
| 877 | // (only support a C function because we can't transfer executable Lua code in keepers) | 877 | // (only support a C function because we can't transfer executable Lua code in keepers) |
| 878 | // will raise an error in L_ in case of problem | 878 | // will raise an error in L_ in case of problem |
| 879 | state::CallOnStateCreate(U, _K, L, LookupMode::ToKeeper); | 879 | U->callOnStateCreate(_K, L, LookupMode::ToKeeper); |
| 880 | 880 | ||
| 881 | // _R[kLindasRegKey] = {} | 881 | // _R[kLindasRegKey] = {} |
| 882 | kLindasRegKey.setValue(_K, [](lua_State* L_) { lua_newtable(L_); }); | 882 | kLindasRegKey.setValue(_K, [](lua_State* L_) { lua_newtable(L_); }); |
