aboutsummaryrefslogtreecommitdiff
path: root/src/universe.cpp
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-03-26 17:46:00 +0100
committerBenoit Germain <benoit.germain@ubisoft.com>2024-03-26 17:46:00 +0100
commitf214d35df5f09e7026dafd8553e83cc6ea21cbde (patch)
tree2bd19bfddf4949183fe0e84ca58940fd6a6aa918 /src/universe.cpp
parent2eeb245b98bd702379aa92d888f7b7d21d1193b8 (diff)
downloadlanes-f214d35df5f09e7026dafd8553e83cc6ea21cbde.tar.gz
lanes-f214d35df5f09e7026dafd8553e83cc6ea21cbde.tar.bz2
lanes-f214d35df5f09e7026dafd8553e83cc6ea21cbde.zip
C++ migration: templated lua_touserdata
Diffstat (limited to 'src/universe.cpp')
-rw-r--r--src/universe.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/universe.cpp b/src/universe.cpp
index 4dd956d..095f000 100644
--- a/src/universe.cpp
+++ b/src/universe.cpp
@@ -67,7 +67,7 @@ Universe* universe_get(lua_State* L)
67 STACK_GROW(L, 2); 67 STACK_GROW(L, 2);
68 STACK_CHECK_START_REL(L, 0); 68 STACK_CHECK_START_REL(L, 0);
69 UNIVERSE_REGKEY.query_registry(L); 69 UNIVERSE_REGKEY.query_registry(L);
70 Universe* const universe = static_cast<Universe*>(lua_touserdata(L, -1)); // nullptr if nil 70 Universe* const universe{ lua_touserdata<Universe>(L, -1) }; // nullptr if nil
71 lua_pop(L, 1); 71 lua_pop(L, 1);
72 STACK_CHECK(L, 0); 72 STACK_CHECK(L, 0);
73 return universe; 73 return universe;