| 902 | } |
| 903 | |
| 904 | DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_change_event event) |
| 905 | { |
| 906 | switch (event) { |
| 907 | case SC_MAP_LOADED: |
| 908 | if (World::isFortressMode() && find_engines(out)) |
| 909 | { |
| 910 | out.print("Detected steam engine workshops - enabling plugin.\n"); |
| 911 | enable_hooks(true); |
| 912 | } |
| 913 | else |
| 914 | enable_hooks(false); |
| 915 | break; |
| 916 | case SC_MAP_UNLOADED: |
| 917 | enable_hooks(false); |
| 918 | engines.clear(); |
| 919 | break; |
| 920 | default: |
| 921 | break; |
| 922 | } |
| 923 | |
| 924 | return CR_OK; |
| 925 | } |
| 926 | |
| 927 | DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) |
| 928 | { |
nothing calls this directly
no test coverage detected