Warn on unset or nil command in RunCommands

This commit is contained in:
Devin J. Pohly
2013-10-20 23:05:26 -04:00
parent 824b84655a
commit 6a91621f10
+6 -1
View File
@@ -1109,11 +1109,16 @@ void Actor::AddRotationR( float rot )
void Actor::RunCommands( const LuaReference& cmds, const LuaReference *pParamTable )
{
if( !cmds.IsSet() || cmds.IsNil() )
{
LOG->Warn( "RunCommands: command is unset or nil" );
return;
}
Lua *L = LUA->Get();
// function
cmds.PushSelf( L );
ASSERT( !lua_isnil(L, -1) );
// 1st parameter
this->PushSelf( L );