Browse Source

Make love.graphics.setCanvas(nil) error

This helps detect typoes, setCanvas() still works as before
Bart van Strien 13 years ago
parent
commit
b10bc87b9a
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/modules/graphics/opengl/wrap_Graphics.cpp

+ 3 - 2
src/modules/graphics/opengl/wrap_Graphics.cpp

@@ -745,8 +745,9 @@ int w_setCanvas(lua_State *L)
 	// discard stencil testing
 	instance->discardStencil();
 
-	// called with nil or none -> reset to default buffer
-	if (lua_isnoneornil(L,1))
+	// called with none -> reset to default buffer
+	// nil is an error, to help people with typoes
+	if (lua_isnone(L,1))
 	{
 		Canvas::bindDefaultCanvas();
 		return 0;