From f81924530856a65d55bc4fe6e9ee340f0a2440e9 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Tue, 16 Dec 2014 01:54:12 +0200 Subject: [PATCH] Eluna Fix Print functions --- GlobalMethods.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/GlobalMethods.h b/GlobalMethods.h index 2d25616..45faed8 100644 --- a/GlobalMethods.h +++ b/GlobalMethods.h @@ -2283,8 +2283,12 @@ namespace LuaGlobalFunctions std::string GetStackAsString(lua_State* L) { std::ostringstream oss; - for (int i = 1; i <= lua_gettop(L); ++i) + int top = lua_gettop(L); + for (int i = 1; i <= top; ++i) + { oss << luaL_tolstring(L, i, NULL); + lua_pop(L, 1); + } return oss.str(); }