summaryrefslogtreecommitdiff
path: root/plugins/power-meter.cpp
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-09-19 19:46:54 +0400
committerAlexander Gavrilov2012-09-19 19:46:54 +0400
commitb5ede66224f2fe9d112bbcf3b748dfa5a0569ca7 (patch)
tree3eeebaaf646957a1d75b2358ce2fbf138a4e183e /plugins/power-meter.cpp
parent19e1711a2ffa9689e1c4a92704126f0f6cb2c0d6 (diff)
downloaddfhack-b5ede66224f2fe9d112bbcf3b748dfa5a0569ca7.tar.gz
dfhack-b5ede66224f2fe9d112bbcf3b748dfa5a0569ca7.tar.bz2
dfhack-b5ede66224f2fe9d112bbcf3b748dfa5a0569ca7.tar.xz
Switch some plugins to using world load/unload instead of map.
Otherwise they apply and remove hooks every time fast travel is used.
Diffstat (limited to 'plugins/power-meter.cpp')
-rw-r--r--plugins/power-meter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/power-meter.cpp b/plugins/power-meter.cpp
index 0466b68e..17261adb 100644
--- a/plugins/power-meter.cpp
+++ b/plugins/power-meter.cpp
@@ -200,7 +200,7 @@ DFHACK_PLUGIN_LUA_FUNCTIONS {
DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_change_event event)
{
switch (event) {
- case SC_MAP_LOADED:
+ case SC_WORLD_LOADED:
{
auto pworld = Core::getInstance().getWorld();
bool enable = pworld->GetPersistentData("power-meter/enabled").isValid();
@@ -212,7 +212,7 @@ DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_chan
}
}
break;
- case SC_MAP_UNLOADED:
+ case SC_WORLD_UNLOADED:
enable_hooks(false);
break;
default:
@@ -224,8 +224,8 @@ DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_chan
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{
- if (Core::getInstance().isMapLoaded())
- plugin_onstatechange(out, SC_MAP_LOADED);
+ if (Core::getInstance().isWorldLoaded())
+ plugin_onstatechange(out, SC_WORLD_LOADED);
return CR_OK;
}