summaryrefslogtreecommitdiff
path: root/plugins/cleanowned.cpp
diff options
context:
space:
mode:
authorPetr Mrázek2011-10-26 23:12:20 +0200
committerPetr Mrázek2011-10-26 23:12:20 +0200
commit1f0e91c3d0769c4fb3a0a77858feb12f67355622 (patch)
treef5504497d26557a5ea3a01f8ba553cdf08793bfa /plugins/cleanowned.cpp
parentb545de7f4308ae55d7d92f5eea091902ee26b15c (diff)
downloaddfhack-1f0e91c3d0769c4fb3a0a77858feb12f67355622.tar.gz
dfhack-1f0e91c3d0769c4fb3a0a77858feb12f67355622.tar.bz2
dfhack-1f0e91c3d0769c4fb3a0a77858feb12f67355622.tar.xz
Add enum for item types.
Diffstat (limited to 'plugins/cleanowned.cpp')
-rw-r--r--plugins/cleanowned.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/plugins/cleanowned.cpp b/plugins/cleanowned.cpp
index 962fb759..dd79d449 100644
--- a/plugins/cleanowned.cpp
+++ b/plugins/cleanowned.cpp
@@ -136,11 +136,21 @@ DFhackCExport command_result df_cleanowned (Core * c, vector <string> & paramete
c->con.print("Confiscating a rotten item: \t");
confiscate = true;
}
- // FIXME: this is wrong
- else if (item->flags.on_ground && (name == "food" || name == "meat" || name == "plant"))
+ else if (item->flags.on_ground)
{
- c->con.print("Confiscating a dropped foodstuff: \t");
- confiscate = true;
+ int32_t type = item->getType();
+ if(type == Items::MEAT ||
+ type == Items::FISH ||
+ type == Items::VERMIN ||
+ type == Items::PET ||
+ type == Items::PLANT ||
+ type == Items::CHEESE ||
+ type == Items::FOOD
+ )
+ {
+ c->con.print("Confiscating a dropped foodstuff/pet vermin: \t");
+ confiscate = true;
+ }
}
else if (item->getWear() >= wear_dump_level)
{