diff options
| author | Petr Mrázek | 2012-03-29 02:49:44 +0200 |
|---|---|---|
| committer | Petr Mrázek | 2012-03-29 02:49:44 +0200 |
| commit | d82120a3db65e82cb54b558fa3da6e28dbe767f2 (patch) | |
| tree | 772f856e9118e725434842ffb7ea3113b5ad511b /library/Core.cpp | |
| parent | 757ad3334cdfacc886338481ae8f3e894ec6fc0d (diff) | |
| download | dfhack-d82120a3db65e82cb54b558fa3da6e28dbe767f2.tar.gz dfhack-d82120a3db65e82cb54b558fa3da6e28dbe767f2.tar.bz2 dfhack-d82120a3db65e82cb54b558fa3da6e28dbe767f2.tar.xz | |
More fixes
Include unistd.h in linux process file
Fix assert in autolabor
Don't print 'script missing' error on DF start
Diffstat (limited to 'library/Core.cpp')
| -rw-r--r-- | library/Core.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/library/Core.cpp b/library/Core.cpp index b298b955..4712be0a 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -70,7 +70,7 @@ using df::global::init; // FIXME: A lot of code in one file, all doing different things... there's something fishy about it. -static void loadScriptFile(Core *core, PluginManager *plug_mgr, string fname); +static void loadScriptFile(Core *core, PluginManager *plug_mgr, string fname, bool silent); static void runInteractiveCommand(Core *core, PluginManager *plug_mgr, int &clueless_counter, const string &command); static bool parseKeySpec(std::string keyspec, int *psym, int *pmod); @@ -492,7 +492,7 @@ static void runInteractiveCommand(Core *core, PluginManager *plug_mgr, int &clue { if(parts.size() == 1) { - loadScriptFile(core, plug_mgr, parts[0]); + loadScriptFile(core, plug_mgr, parts[0], false); } else { @@ -512,9 +512,10 @@ static void runInteractiveCommand(Core *core, PluginManager *plug_mgr, int &clue } } -static void loadScriptFile(Core *core, PluginManager *plug_mgr, string fname) +static void loadScriptFile(Core *core, PluginManager *plug_mgr, string fname, bool silent) { - core->getConsole() << "Loading script at " << fname << std::endl; + if(!silent) + core->getConsole() << "Loading script at " << fname << std::endl; ifstream script(fname); if (script.good()) { @@ -528,7 +529,8 @@ static void loadScriptFile(Core *core, PluginManager *plug_mgr, string fname) } else { - core->getConsole().printerr("Error loading script\n"); + if(!silent) + core->getConsole().printerr("Error loading script\n"); } script.close(); @@ -551,7 +553,7 @@ void fIOthread(void * iodata) return; } - loadScriptFile(core, plug_mgr, "dfhack.init"); + loadScriptFile(core, plug_mgr, "dfhack.init", true); con.print("DFHack is ready. Have a nice day!\n" "Type in '?' or 'help' for general help, 'ls' to see all commands.\n"); |
