From 83d3eae1e7761034e831757a562a1fb23859946a Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 4 Nov 2013 15:03:45 -0400 Subject: [PATCH] Fixed error messages in Shader:send and love.math.newRandomGenerator to include the line number --- src/modules/graphics/opengl/wrap_Shader.cpp | 6 +++--- src/modules/math/wrap_Math.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/graphics/opengl/wrap_Shader.cpp b/src/modules/graphics/opengl/wrap_Shader.cpp index a5647706a..a2cb1eb45 100644 --- a/src/modules/graphics/opengl/wrap_Shader.cpp +++ b/src/modules/graphics/opengl/wrap_Shader.cpp @@ -144,7 +144,7 @@ int w_Shader_sendInt(lua_State *L) delete[] values; if (should_error) - return lua_error(L); + return luaL_error(L, "%s", lua_tostring(L, -1)); return 0; } @@ -185,7 +185,7 @@ int w_Shader_sendFloat(lua_State *L) delete[] values; if (should_error) - return lua_error(L); + return luaL_error(L, "%s", lua_tostring(L, -1)); return 0; } @@ -248,7 +248,7 @@ int w_Shader_sendMatrix(lua_State *L) delete[] values; if (should_error) - return lua_error(L); + return luaL_error(L, "%s", lua_tostring(L, -1)); return 0; } diff --git a/src/modules/math/wrap_Math.cpp b/src/modules/math/wrap_Math.cpp index 05d0a33b7..029b313e4 100644 --- a/src/modules/math/wrap_Math.cpp +++ b/src/modules/math/wrap_Math.cpp @@ -86,7 +86,7 @@ int w_newRandomGenerator(lua_State *L) } if (should_error) - return lua_error(L); + return luaL_error(L, "%s", lua_tostring(L, -1)); } luax_pushtype(L, "RandomGenerator", MATH_RANDOM_GENERATOR_T, t);