From cc9f7c06b39ce840d0dcde36e816cf025bd7ce81 Mon Sep 17 00:00:00 2001 From: x12xx12x <44411062+12xx12@users.noreply.github.com> Date: Wed, 23 Jun 2021 00:09:06 +0200 Subject: Add optional prefix parameter to LOG functions (#5229) Co-authored-by: Tiger Wang --- src/Bindings/LuaState.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/Bindings/LuaState.cpp') 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 bool cLuaState::GetStackValue(int a_StackPos, Vector3 & a_ReturnedVal) { -- cgit v1.2.3