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

Function hook_refs

plugins/devel/ref-index.cpp:114–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112IMPLEMENT_VMETHOD_INTERPOSE(unit_hook, getUnit);
113
114command_result hook_refs(color_ostream &out, vector <string> & parameters)
115{
116 auto &hook = INTERPOSE_HOOK(item_hook, getItem);
117 if (hook.is_applied())
118 {
119 hook.remove();
120 INTERPOSE_HOOK(unit_hook, getUnit).remove();
121 }
122 else
123 {
124 hook.apply();
125 INTERPOSE_HOOK(unit_hook, getUnit).apply();
126 }
127
128 if (hook.is_applied())
129 out.print("Hook is applied.\n");
130 else
131 out.print("Hook is not applied.\n");
132 return CR_OK;
133}
134#endif
135
136DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)

Callers

nothing calls this directly

Calls 3

removeMethod · 0.45
applyMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected