Browse Source

Fixed error messages in Shader:send and love.math.newRandomGenerator to include the line number

Alex Szpakowski 11 years ago
parent
commit
83d3eae1e7
2 changed files with 4 additions and 4 deletions
  1. 3 3
      src/modules/graphics/opengl/wrap_Shader.cpp
  2. 1 1
      src/modules/math/wrap_Math.cpp

+ 3 - 3
src/modules/graphics/opengl/wrap_Shader.cpp

@@ -144,7 +144,7 @@ int w_Shader_sendInt(lua_State *L)
 	delete[] values;
 	delete[] values;
 
 
 	if (should_error)
 	if (should_error)
-		return lua_error(L);
+		return luaL_error(L, "%s", lua_tostring(L, -1));
 
 
 	return 0;
 	return 0;
 }
 }
@@ -185,7 +185,7 @@ int w_Shader_sendFloat(lua_State *L)
 	delete[] values;
 	delete[] values;
 
 
 	if (should_error)
 	if (should_error)
-		return lua_error(L);
+		return luaL_error(L, "%s", lua_tostring(L, -1));
 
 
 	return 0;
 	return 0;
 }
 }
@@ -248,7 +248,7 @@ int w_Shader_sendMatrix(lua_State *L)
 	delete[] values;
 	delete[] values;
 
 
 	if (should_error)
 	if (should_error)
-		return lua_error(L);
+		return luaL_error(L, "%s", lua_tostring(L, -1));
 
 
 	return 0;
 	return 0;
 }
 }

+ 1 - 1
src/modules/math/wrap_Math.cpp

@@ -86,7 +86,7 @@ int w_newRandomGenerator(lua_State *L)
 		}
 		}
 
 
 		if (should_error)
 		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);
 	luax_pushtype(L, "RandomGenerator", MATH_RANDOM_GENERATOR_T, t);