summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaState.cpp
diff options
context:
space:
mode:
authorx12xx12x <44411062+12xx12@users.noreply.github.com>2021-06-23 00:09:06 +0200
committerGitHub <noreply@github.com>2021-06-23 00:09:06 +0200
commitcc9f7c06b39ce840d0dcde36e816cf025bd7ce81 (patch)
treea2adc4d33fbba4915e245133ff3896aecd2a798d /src/Bindings/LuaState.cpp
parentDeath messages for tamed pets and ocelots are now tamable. (#5243) (diff)
downloadcuberite-cc9f7c06b39ce840d0dcde36e816cf025bd7ce81.tar
cuberite-cc9f7c06b39ce840d0dcde36e816cf025bd7ce81.tar.gz
cuberite-cc9f7c06b39ce840d0dcde36e816cf025bd7ce81.tar.bz2
cuberite-cc9f7c06b39ce840d0dcde36e816cf025bd7ce81.tar.lz
cuberite-cc9f7c06b39ce840d0dcde36e816cf025bd7ce81.tar.xz
cuberite-cc9f7c06b39ce840d0dcde36e816cf025bd7ce81.tar.zst
cuberite-cc9f7c06b39ce840d0dcde36e816cf025bd7ce81.zip
Diffstat (limited to 'src/Bindings/LuaState.cpp')
-rw-r--r--src/Bindings/LuaState.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp
index ccd7244fa..3a1379df1 100644
--- a/src/Bindings/LuaState.cpp
+++ b/src/Bindings/LuaState.cpp
@@ -1489,6 +1489,22 @@ bool cLuaState::GetStackValue(int a_StackPos, cUUID & a_Value)
+bool cLuaState::GetStackValue(int a_StackPos, std::string_view & a_Value)
+{
+ size_t Length = 0;
+ const char * const Value = lua_tolstring(m_LuaState, a_StackPos, &Length);
+ if (Value != nullptr)
+ {
+ a_Value = { Value, Length };
+ return true;
+ }
+ return false;
+}
+
+
+
+
+
template <typename T>
bool cLuaState::GetStackValue(int a_StackPos, Vector3<T> & a_ReturnedVal)
{