| 86 | } |
| 87 | |
| 88 | DFhackCExport command_result plugin_load_site_data (color_ostream &out) { |
| 89 | config = World::GetPersistentSiteData(CONFIG_KEY); |
| 90 | |
| 91 | if (!config.isValid()) { |
| 92 | DEBUG(control,out).print("no config found in this save; initializing\n"); |
| 93 | config = World::AddPersistentSiteData(CONFIG_KEY); |
| 94 | set_state(out, false, false); |
| 95 | } else { |
| 96 | is_enabled = config.get_int(CONFIG_FAST) || config.get_int(CONFIG_TELE); |
| 97 | DEBUG(control,out).print("loading persisted state: fast={}, tele={}\n", |
| 98 | config.get_int(CONFIG_FAST), |
| 99 | config.get_int(CONFIG_TELE)); |
| 100 | } |
| 101 | |
| 102 | return CR_OK; |
| 103 | } |
| 104 | |
| 105 | DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_change_event event) { |
| 106 | if (event == DFHack::SC_WORLD_UNLOADED) { |