| 264 | } |
| 265 | |
| 266 | static command_result do_command(color_ostream &out, vector<string> ¶meters) { |
| 267 | if (!World::isFortressMode() || !Core::getInstance().isMapLoaded()) { |
| 268 | out.printerr("Cannot run {} without a loaded fort.\n", plugin_name); |
| 269 | return CR_FAILURE; |
| 270 | } |
| 271 | |
| 272 | bool show_help = false; |
| 273 | if (!Lua::CallLuaModuleFunction(out, "plugins.preserve-rooms", "parse_commandline", std::make_tuple(parameters), |
| 274 | 1, [&](lua_State *L) { |
| 275 | show_help = !lua_toboolean(L, -1); |
| 276 | })) { |
| 277 | return CR_FAILURE; |
| 278 | } |
| 279 | |
| 280 | return show_help ? CR_WRONG_USAGE : CR_OK; |
| 281 | } |
| 282 | |
| 283 | ///////////////////////////////////////////////////// |
| 284 | // cycle logic |
nothing calls this directly
no test coverage detected