Changeset - r19644:956473a8e0a3
[Not reviewed]
master
0 1 0
zuu - 12 years ago 2012-10-05 19:16:23
zuu@openttd.org
(svn r24575) -Add: ScriptController::Break() now also pauses the game (and not only the script)
1 file changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/script/api/script_controller.cpp
Show inline comments
 
@@ -48,24 +48,28 @@
 
{
 
	if (_network_dedicated || !_settings_client.gui.ai_developer_tools) return;
 

	
 
	ScriptObject::GetActiveInstance()->Pause();
 

	
 
	char log_message[1024];
 
	snprintf(log_message, sizeof(log_message), "Break: %s", message);
 
	ScriptLog::Log(ScriptLog::LOG_SQ_ERROR, log_message);
 

	
 
	/* Inform script developer that his script has been paused and
 
	 * needs manual action to continue. */
 
	ShowAIDebugWindow(ScriptObject::GetRootCompany());
 

	
 
	if ((_pause_mode & PM_PAUSED_NORMAL) == PM_UNPAUSED) {
 
		ScriptObject::DoCommand(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE);
 
	}
 
}
 

	
 
/* static */ void ScriptController::Print(bool error_msg, const char *message)
 
{
 
	ScriptLog::Log(error_msg ? ScriptLog::LOG_SQ_ERROR : ScriptLog::LOG_SQ_INFO, message);
 
}
 

	
 
ScriptController::ScriptController(CompanyID company) :
 
	ticks(0),
 
	loaded_library_count(0)
 
{
 
	ScriptObject::SetCompany(company);
0 comments (0 inline, 0 general)