summaryrefslogtreecommitdiff
path: root/plugins/tiletypes.cpp
diff options
context:
space:
mode:
authorQuietust2012-01-21 18:31:15 -0600
committerQuietust2012-01-21 18:31:15 -0600
commit2cc6bcf0e97dbdf60492067cd71dc79432a35687 (patch)
treee893504d15ef59e8803573f6f4483d2e3ec9ca34 /plugins/tiletypes.cpp
parentccf22bed10a78504701bbdb1f8177a16cf9ffdde (diff)
downloaddfhack-2cc6bcf0e97dbdf60492067cd71dc79432a35687.tar.gz
dfhack-2cc6bcf0e97dbdf60492067cd71dc79432a35687.tar.bz2
dfhack-2cc6bcf0e97dbdf60492067cd71dc79432a35687.tar.xz
Use CoreSuspender and namespace df::enums
Diffstat (limited to 'plugins/tiletypes.cpp')
-rw-r--r--plugins/tiletypes.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/plugins/tiletypes.cpp b/plugins/tiletypes.cpp
index c06a6382..ea154ed1 100644
--- a/plugins/tiletypes.cpp
+++ b/plugins/tiletypes.cpp
@@ -22,6 +22,7 @@ using std::set;
#include "df/tile_dig_designation.h"
using namespace MapExtras;
using namespace DFHack;
+using namespace df::enums;
//zilpin: These two functions were giving me compile errors in VS2008, so I cheated with the C style loop below, just to get it to build.
//Original code is commented out.
@@ -753,12 +754,11 @@ DFhackCExport command_result df_tiletypes (Core * c, vector <string> & parameter
continue;
}
- c->Suspend();
+ CoreSuspender suspend(c);
gui = c->getGui();
if (!Maps::IsValid())
{
c->con.printerr("Map is not available!\n");
- c->Resume();
return CR_FAILURE;
}
Maps::getSize(x_max, y_max, z_max);
@@ -766,7 +766,6 @@ DFhackCExport command_result df_tiletypes (Core * c, vector <string> & parameter
if (!(gui->Start() && gui->getCursorCoords(x,y,z)))
{
c->con.printerr("Can't get cursor coords! Make sure you have a cursor active in DF.\n");
- c->Resume();
return CR_FAILURE;
}
c->con.print("Cursor coords: (%d, %d, %d)\n",x,y,z);
@@ -785,7 +784,7 @@ DFhackCExport command_result df_tiletypes (Core * c, vector <string> & parameter
|| (filter.material > -1 && filter.material != source->material)
|| (filter.special > -1 && filter.special != source->special)
|| (filter.variant > -1 && filter.variant != source->variant)
- || (filter.dig > -1 && (filter.dig != 0) != (des.bits.dig != df::tile_dig_designation::No))
+ || (filter.dig > -1 && (filter.dig != 0) != (des.bits.dig != tile_dig_designation::No))
)
{
continue;
@@ -890,7 +889,6 @@ DFhackCExport command_result df_tiletypes (Core * c, vector <string> & parameter
{
c->con.printerr("Something failed horribly! RUN!\n");
}
- c->Resume();
}
}
return CR_OK;