| 112 | IMPLEMENT_VMETHOD_INTERPOSE(unit_hook, getUnit); |
| 113 | |
| 114 | command_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 | |
| 136 | DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) |