| 2008 | } |
| 2009 | |
| 2010 | DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_change_event event) |
| 2011 | { |
| 2012 | switch (event) { |
| 2013 | case SC_MAP_LOADED: |
| 2014 | if (!gamemode || *gamemode == game_mode::DWARF) |
| 2015 | { |
| 2016 | bool enable = World::GetPersistentData("siege-engine/enabled").isValid(); |
| 2017 | |
| 2018 | if (enable) |
| 2019 | { |
| 2020 | out.print("Enabling the siege engine plugin.\n"); |
| 2021 | enable_hooks(true); |
| 2022 | } |
| 2023 | else |
| 2024 | enable_hooks(false); |
| 2025 | } |
| 2026 | break; |
| 2027 | case SC_MAP_UNLOADED: |
| 2028 | enable_hooks(false); |
| 2029 | break; |
| 2030 | default: |
| 2031 | break; |
| 2032 | } |
| 2033 | |
| 2034 | return CR_OK; |
| 2035 | } |
| 2036 | |
| 2037 | DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) |
| 2038 | { |
nothing calls this directly
no test coverage detected