Called to notify the plugin about important state changes. Invoked with DF suspended, and always before the matching plugin_onupdate. More event codes may be added in the future.
| 222 | // Invoked with DF suspended, and always before the matching plugin_onupdate. |
| 223 | // More event codes may be added in the future. |
| 224 | DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_change_event event) { |
| 225 | switch (event) |
| 226 | { |
| 227 | case SC_WORLD_UNLOADED: |
| 228 | clothingOrders.clear(); |
| 229 | is_enabled = false; |
| 230 | break; |
| 231 | default: |
| 232 | break; |
| 233 | } |
| 234 | return CR_OK; |
| 235 | } |
| 236 | |
| 237 | DFhackCExport command_result plugin_load_site_data(color_ostream &out) { |
| 238 | cycle_timestamp = 0; |