diff options
| author | Alexander Gavrilov | 2012-04-21 16:53:17 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-04-21 16:53:17 +0400 |
| commit | 4af051bab3e455a9115a44e43b8c3da0cd189f43 (patch) | |
| tree | 377a687ab333ed856b739dd993833cbbcd263e56 /plugins/Dfusion | |
| parent | 3282ac3db216ef43cab5744631b57ed05bcf8a12 (diff) | |
| download | dfhack-4af051bab3e455a9115a44e43b8c3da0cd189f43.tar.gz dfhack-4af051bab3e455a9115a44e43b8c3da0cd189f43.tar.bz2 dfhack-4af051bab3e455a9115a44e43b8c3da0cd189f43.tar.xz | |
Add a few more unit orderings, and a way to reverse direction.
Diffstat (limited to 'plugins/Dfusion')
| -rw-r--r-- | plugins/Dfusion/dfusion.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/plugins/Dfusion/dfusion.cpp b/plugins/Dfusion/dfusion.cpp index d8710c2d..2b36a974 100644 --- a/plugins/Dfusion/dfusion.cpp +++ b/plugins/Dfusion/dfusion.cpp @@ -121,10 +121,26 @@ command_result lua_run_file (color_ostream &out, std::vector <std::string> ¶ } command_result lua_run (color_ostream &out, std::vector <std::string> ¶meters) { - if (!parameters.empty() && parameters[0] == "--core-context") + if (!parameters.empty()) { - Lua::InterpreterLoop(out, Lua::Core::State, "core lua"); - return CR_OK; + if (parameters[0] == "--core-context") + { + Lua::InterpreterLoop(out, Lua::Core::State, "core lua"); + return CR_OK; + } + else if (parameters[0] == "--core-reload") + { + CoreSuspender suspend; + + for (size_t i = 1; i < parameters.size(); i++) + { + lua_getglobal(Lua::Core::State, "reload"); + lua_pushstring(Lua::Core::State, parameters[i].c_str()); + Lua::SafeCall(out, Lua::Core::State, 1, 0); + } + + return CR_OK; + } } mymutex->lock(); |
