|
|
@ -56,8 +56,15 @@ DFhackCExport command_result plugin_onupdate ( Core * c )
|
|
|
|
s.getglobal("OnTick");
|
|
|
|
s.getglobal("OnTick");
|
|
|
|
if(s.is<lua::function>())
|
|
|
|
if(s.is<lua::function>())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
try{
|
|
|
|
s.pcall();
|
|
|
|
s.pcall();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
catch(lua::exception &e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
c->con.printerr("Error OnTick:%s\n",e.what());
|
|
|
|
|
|
|
|
c->con.msleep(1000);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
s.settop(0);
|
|
|
|
s.settop(0);
|
|
|
|
SDL_mutexV(mymutex);
|
|
|
|
SDL_mutexV(mymutex);
|
|
|
|
return CR_OK;
|
|
|
|
return CR_OK;
|
|
|
@ -74,7 +81,6 @@ DFhackCExport command_result dfusion (Core * c, vector <string> & parameters)
|
|
|
|
try{
|
|
|
|
try{
|
|
|
|
s.loadfile("dfusion/init.lua"); //load script
|
|
|
|
s.loadfile("dfusion/init.lua"); //load script
|
|
|
|
s.pcall(0,0);// run it
|
|
|
|
s.pcall(0,0);// run it
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch(lua::exception &e)
|
|
|
|
catch(lua::exception &e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|