From b10bc87b9a41e10002bd893963868c9826ad24fb Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Sat, 21 Jul 2012 17:51:54 +0200 Subject: [PATCH] Make love.graphics.setCanvas(nil) error This helps detect typoes, setCanvas() still works as before --- src/modules/graphics/opengl/wrap_Graphics.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/graphics/opengl/wrap_Graphics.cpp b/src/modules/graphics/opengl/wrap_Graphics.cpp index 5e69f5dc4..d452c22eb 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.cpp +++ b/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;