|
|
@ -500,12 +500,8 @@ static void loadScriptFile(Core *core, PluginManager *plug_mgr, string fname)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
core->con << "Loading script at " << fname << std::endl;
|
|
|
|
core->con << "Loading script at " << fname << std::endl;
|
|
|
|
ifstream script(fname);
|
|
|
|
ifstream script(fname);
|
|
|
|
if (script.bad())
|
|
|
|
if (script.good())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
core->con.printerr("Error loading script\n");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int tmp = 0;
|
|
|
|
int tmp = 0;
|
|
|
|
string command;
|
|
|
|
string command;
|
|
|
|
while (getline(script, command))
|
|
|
|
while (getline(script, command))
|
|
|
@ -513,6 +509,13 @@ static void loadScriptFile(Core *core, PluginManager *plug_mgr, string fname)
|
|
|
|
if (!command.empty())
|
|
|
|
if (!command.empty())
|
|
|
|
runInteractiveCommand(core, plug_mgr, tmp, command);
|
|
|
|
runInteractiveCommand(core, plug_mgr, tmp, command);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
core->con.printerr("Error loading script\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
script.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// A thread function... for the interactive console.
|
|
|
|
// A thread function... for the interactive console.
|
|
|
|