summaryrefslogtreecommitdiff
path: root/plugins/cleanowned.cpp
diff options
context:
space:
mode:
authorQuietust2012-01-27 22:02:25 -0600
committerQuietust2012-01-27 22:02:25 -0600
commita36e7f4298578420016546c3453e7ccdf96911b5 (patch)
tree8b9a7996f004f40ac6f3d70187864922aaa40b4e /plugins/cleanowned.cpp
parent69b8f168cc3d7777c9a3799536c5031b85ebc821 (diff)
downloaddfhack-a36e7f4298578420016546c3453e7ccdf96911b5.tar.gz
dfhack-a36e7f4298578420016546c3453e7ccdf96911b5.tar.bz2
dfhack-a36e7f4298578420016546c3453e7ccdf96911b5.tar.xz
Cleanowned doesn't need Materials, but it does need Translation in order to print names
Diffstat (limited to 'plugins/cleanowned.cpp')
-rw-r--r--plugins/cleanowned.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/cleanowned.cpp b/plugins/cleanowned.cpp
index 2cc21371..dec59163 100644
--- a/plugins/cleanowned.cpp
+++ b/plugins/cleanowned.cpp
@@ -16,7 +16,6 @@ using namespace std;
#include <string>
#include "modules/Items.h"
#include "modules/Units.h"
-#include "modules/Materials.h"
#include "modules/Translation.h"
#include "DataDefs.h"
#include "df/world.h"
@@ -96,9 +95,11 @@ DFhackCExport command_result df_cleanowned (Core * c, vector <string> & paramete
CoreSuspender suspend(c);
- DFHack::Materials *Materials = c->getMaterials();
-
- bool ok = Materials->ReadAllMaterials();
+ if (!Translation::IsValid())
+ {
+ c->con.printerr("Translation data unavailable!\n");
+ return CR_FAILURE;
+ }
c->con.print("Found total %d items.\n", world->items.all.size());
@@ -181,7 +182,6 @@ DFhackCExport command_result df_cleanowned (Core * c, vector <string> & paramete
);
df::unit *owner = Items::getItemOwner(item);
- std::string info;
if (owner)
c->con.print(", owner %s", Translation::TranslateName(&owner->name,false).c_str());