MCPcopy Create free account
hub / github.com/DFHack/dfhack / command_result plugin_enable

Function command_result plugin_enable

plugins/workflow.cpp:1313–1332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1311 *************/
1312
1313DFhackCExport command_result plugin_enable(color_ostream &out, bool enable)
1314{
1315 if (!Core::getInstance().isWorldLoaded()) {
1316 out.printerr("World is not loaded: please load a game first.\n");
1317 return CR_FAILURE;
1318 }
1319
1320 if (enable && !enabled)
1321 {
1322 enable_plugin(out);
1323 }
1324 else if (!enable && enabled)
1325 {
1326 enabled = false;
1327 setOptionEnabled(CF_ENABLED, false);
1328 stop_protect(out);
1329 }
1330
1331 return CR_OK;
1332}
1333
1334static void push_count_history(lua_State *L, ItemConstraint *icv)
1335{

Callers

nothing calls this directly

Calls 3

stop_protectFunction · 0.85
enable_pluginFunction · 0.70
setOptionEnabledFunction · 0.70

Tested by

no test coverage detected