From 52a049cec3257fafa16f09ec6a7b263d722535bf Mon Sep 17 00:00:00 2001 From: Warmist Date: Tue, 27 Dec 2011 23:07:23 +0200 Subject: [PATCH] Removed thready argument to dfusion, replaced with init (just sets stuff up, running everything in non interactive mode) --- plugins/Dfusion/dfusion.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/plugins/Dfusion/dfusion.cpp b/plugins/Dfusion/dfusion.cpp index b1e85dbd3..cbe84aef9 100644 --- a/plugins/Dfusion/dfusion.cpp +++ b/plugins/Dfusion/dfusion.cpp @@ -56,7 +56,7 @@ DFhackCExport command_result plugin_init ( Core * c, std::vector st.setglobal("WINDOWS"); #endif - commands.push_back(PluginCommand("dfusion","Init dfusion system. Use 'dfusion thready' to spawn a different thread.",dfusion)); + commands.push_back(PluginCommand("dfusion","Init dfusion system. Use 'dfusion init' to run dfusion in init mode (not interactive).",dfusion)); commands.push_back(PluginCommand("lua", "Run interactive interpreter. Use 'lua ' to run instead.",lua_run)); mymutex=new tthread::mutex; @@ -174,13 +174,18 @@ void RunDfusion(void *p) } DFhackCExport command_result dfusion (Core * c, vector & parameters) { - if(thread_dfusion==0) - thread_dfusion=new tthread::thread(RunDfusion,c); - if(parameters[0]!="thready") + if(parameters[0]=="init") { - thread_dfusion->join(); - delete thread_dfusion; - thread_dfusion=0; + lua::state s=lua::glua::Get(); + s.push(1); + s.setglobal("INIT"); + } + else + { + lua::state s=lua::glua::Get(); + s.push(); + s.setglobal("INIT"); } + RunDfusion(c); return CR_OK; }