Add some tests for UnitAI.

Fix said tests for UnitAI.
Hopefully fix #647 too.
Document HFSM interface a bit.
Add Engine.DumpSimState() console command for debugging.

This was SVN commit r8681.
This commit is contained in:
Ykkrosh
2010-11-22 20:12:04 +00:00
parent 78ae72d87a
commit f378a63d94
6 changed files with 257 additions and 10 deletions
+8
View File
@@ -379,6 +379,13 @@ void ForceGC(void* cbdata)
g_Console->InsertMessage(L"Garbage collection completed in: %f", time);
}
void DumpSimState(void* UNUSED(cbdata))
{
fs::wpath path (psLogDir()/L"sim_dump.txt");
std::ofstream file (path.external_file_string().c_str(), std::ofstream::out | std::ofstream::trunc);
g_Game->GetSimulation2()->DumpDebugState(file);
}
} // namespace
void GuiScriptingInit(ScriptInterface& scriptInterface)
@@ -430,4 +437,5 @@ void GuiScriptingInit(ScriptInterface& scriptInterface)
scriptInterface.RegisterFunction<int, &Crash>("Crash");
scriptInterface.RegisterFunction<void, &DebugWarn>("DebugWarn");
scriptInterface.RegisterFunction<void, &ForceGC>("ForceGC");
scriptInterface.RegisterFunction<void, &DumpSimState>("DumpSimState");
}