warn on bad DrawFunction

This commit is contained in:
Devin J. Pohly
2013-11-01 21:52:15 -04:00
parent 7d4330dad1
commit af5022d7a8
+5 -1
View File
@@ -236,7 +236,11 @@ void ActorFrame::DrawPrimitives()
{
Lua *L = LUA->Get();
m_DrawFunction.PushSelf( L );
ASSERT( !lua_isnil(L, -1) );
if( lua_isnil(L, -1) )
{
LOG->Warn( "Error compiling DrawFunction" );
return;
}
this->PushSelf( L );
RString sError;
if( !LuaHelpers::RunScriptOnStack(L, sError, 1, 0) ) // 1 arg, 0 results