Lineage reporting for nil commands in RunCommands. Stricter type checking for FormatPercentScore in PercentageDisplay.

This commit is contained in:
Kyzentun
2014-10-28 20:32:38 -06:00
parent 034790849d
commit 5639a0d31f
4 changed files with 34 additions and 19 deletions
+4 -4
View File
@@ -785,7 +785,7 @@ RString Actor::GetLineage() const
if( m_pParent )
sPath = m_pParent->GetLineage() + '/';
sPath += ssprintf( "<%s> %s", typeid(*this).name(), m_sName.c_str() );
sPath += ssprintf( "<type %s> %s", typeid(*this).name(), m_sName.c_str() );
return sPath;
}
@@ -1130,7 +1130,7 @@ void Actor::RunCommands( const LuaReference& cmds, const LuaReference *pParamTab
{
if( !cmds.IsSet() || cmds.IsNil() )
{
LuaHelpers::ReportScriptError("RunCommands: command is unset or nil");
LuaHelpers::ReportScriptErrorFmt("RunCommands: commands for %s are unset or nil", GetLineage().c_str());
return;
}
@@ -1140,7 +1140,7 @@ void Actor::RunCommands( const LuaReference& cmds, const LuaReference *pParamTab
cmds.PushSelf( L );
if( lua_isnil(L, -1) )
{
LuaHelpers::ReportScriptError("Error compiling commands");
LuaHelpers::ReportScriptErrorFmt("RunCommands: Error compiling commands for %s", GetLineage().c_str());
LUA->Release(L);
return;
}
@@ -1155,7 +1155,7 @@ void Actor::RunCommands( const LuaReference& cmds, const LuaReference *pParamTab
pParamTable->PushSelf( L );
// call function with 2 arguments and 0 results
RString Error= "Error playing command: ";
RString Error= "Error playing command:";
LuaHelpers::RunScriptOnStack(L, Error, 2, 0, true);
LUA->Release(L);