aboutsummaryrefslogtreecommitdiff
path: root/src/deep.cpp
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-06-24 18:03:06 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-06-24 18:03:06 +0200
commit5e3f33bd66ef5b21568fde7866ca4ba9a7496180 (patch)
treed2692b78cb20655de5ebf842de72fd2b806d12db /src/deep.cpp
parent0a481b9aef3726763c572ad3ce6d44ea14dd35ba (diff)
downloadlanes-5e3f33bd66ef5b21568fde7866ca4ba9a7496180.tar.gz
lanes-5e3f33bd66ef5b21568fde7866ca4ba9a7496180.tar.bz2
lanes-5e3f33bd66ef5b21568fde7866ca4ba9a7496180.zip
Lindas now accept deep user data as valid keys
Diffstat (limited to 'src/deep.cpp')
-rw-r--r--src/deep.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/deep.cpp b/src/deep.cpp
index 8754178..bac011f 100644
--- a/src/deep.cpp
+++ b/src/deep.cpp
@@ -130,8 +130,15 @@ void DeepFactory::DeleteDeepObject(lua_State* const L_, DeepPrelude* const o_)
130 130
131// ################################################################################################# 131// #################################################################################################
132 132
133bool DeepFactory::IsDeepUserdata(lua_State* const L_, int const idx_)
134{
135 return LookupFactory(L_, idx_, LookupMode::LaneBody) != nullptr;
136}
137
138// #################################################################################################
139
133// Return the registered factory for 'index' (deep userdata proxy), or nullptr if 'index' is not a deep userdata proxy. 140// Return the registered factory for 'index' (deep userdata proxy), or nullptr if 'index' is not a deep userdata proxy.
134[[nodiscard]] DeepFactory* DeepFactory::LookupFactory(lua_State* const L_, int const index_, LookupMode const mode_) 141DeepFactory* DeepFactory::LookupFactory(lua_State* const L_, int const index_, LookupMode const mode_)
135{ 142{
136 // when looking inside a keeper, we are 100% sure the object is a deep userdata 143 // when looking inside a keeper, we are 100% sure the object is a deep userdata
137 if (mode_ == LookupMode::FromKeeper) { 144 if (mode_ == LookupMode::FromKeeper) {