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

Function command_result plugin_onstatechange

plugins/building-hacks.cpp:467–482  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

465 INTERPOSE_HOOK(work_hook,drawBuilding).apply(enable);
466}
467DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_change_event event)
468{
469 switch (event) {
470 case SC_WORLD_LOADED:
471 enable_hooks(true);
472 break;
473 case SC_WORLD_UNLOADED:
474 enable_hooks(false);
475 clear_mapping();
476 break;
477 default:
478 break;
479 }
480
481 return CR_OK;
482}
483DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
484{
485 enable_hooks(true);

Callers

nothing calls this directly

Calls 2

clear_mappingFunction · 0.85
enable_hooksFunction · 0.70

Tested by

no test coverage detected