MCPcopy Create free account
hub / github.com/DFHack/dfhack / infiniteSky

Function infiniteSky

plugins/infinite-sky.cpp:283–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281struct_identity infinitesky_options::_identity{sizeof(infinitesky_options), &df::allocator_fn<infinitesky_options>, NULL, "infinitesky_options", NULL, infinitesky_options_fields};
282
283command_result infiniteSky(color_ostream &out,
284 std::vector<std::string> &parameters) {
285 if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) {
286 out.printerr("Cannot run {} without a loaded fort.\n", plugin_name);
287 return CR_FAILURE;
288 }
289
290 infinitesky_options opts;
291 if (!Lua::CallLuaModuleFunction(out, "plugins.infinite-sky",
292 "parse_commandline",
293 std::make_tuple(&opts, parameters)) ||
294 opts.help)
295 return CR_WRONG_USAGE;
296
297 if (opts.n > 0) {
298 out.print("Infinite-sky: creating {} new z-level{} of sky.\n", opts.n,
299 opts.n == 1 ? "" : "s");
300 doInfiniteSky(out, opts.n);
301 } else {
302 out.print("Construction monitoring is {}.\n",
303 is_enabled ? "enabled" : "disabled");
304 }
305 return CR_OK;
306}

Callers

nothing calls this directly

Calls 3

CallLuaModuleFunctionFunction · 0.85
doInfiniteSkyFunction · 0.85
printMethod · 0.45

Tested by

no test coverage detected