From 35ad84c58a0a35732d14cc6e31e457e28546e721 Mon Sep 17 00:00:00 2001 From: Quietust Date: Wed, 18 Jan 2012 08:26:08 -0600 Subject: [PATCH] angavrilov changed general_ref_type to be all uppercase --- library/modules/Items.cpp | 10 +++++----- plugins/autodump.cpp | 2 +- plugins/workflow.cpp | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/library/modules/Items.cpp b/library/modules/Items.cpp index d54a56f13..3b731c0d0 100644 --- a/library/modules/Items.cpp +++ b/library/modules/Items.cpp @@ -1,4 +1,4 @@ -/* +/* https://github.com/peterix/dfhack Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com) @@ -430,7 +430,7 @@ int32_t Items::getItemOwnerID(const df::item * item) for (uint32_t i = 0; i < item->itemrefs.size(); i++) { df::general_ref *ref = item->itemrefs[i]; - if (ref->getType() == df::general_ref_type::unit_itemowner) + if (ref->getType() == df::general_ref_type::UNIT_ITEMOWNER) return ref->getID(); } return -1; @@ -441,7 +441,7 @@ int32_t Items::getItemContainerID(const df::item * item) for (uint32_t i = 0; i < item->itemrefs.size(); i++) { df::general_ref *ref = item->itemrefs[i]; - if (ref->getType() == df::general_ref_type::contained_in_item) + if (ref->getType() == df::general_ref_type::CONTAINED_IN_ITEM) return ref->getID(); } return -1; @@ -449,7 +449,7 @@ int32_t Items::getItemContainerID(const df::item * item) bool Items::getContainedItems(const df::item * item, std::vector &items) { - return readItemRefs(item, df::general_ref_type::contains_item, items); + return readItemRefs(item, df::general_ref_type::CONTAINS_ITEM, items); } bool Items::readItemRefs(const df::item * item, df::general_ref_type type, std::vector &values) @@ -471,7 +471,7 @@ bool Items::removeItemOwner(df::item * item, Units *creatures) for (uint32_t i = 0; i < item->itemrefs.size(); i++) { df::general_ref *ref = item->itemrefs[i]; - if (ref->getType() != df::general_ref_type::unit_itemowner) + if (ref->getType() != df::general_ref_type::UNIT_ITEMOWNER) continue; df_unit *unit = (df_unit *)ref->getUnit(); diff --git a/plugins/autodump.cpp b/plugins/autodump.cpp index 8c7f9a16b..d36854bbf 100644 --- a/plugins/autodump.cpp +++ b/plugins/autodump.cpp @@ -330,7 +330,7 @@ DFhackCExport command_result df_autodump_destroy_item(Core * c, vector for (unsigned i = 0; i < item->itemrefs.size(); i++) { df::general_ref *ref = item->itemrefs[i]; - if (ref->getType() == df::general_ref_type::unit_holder) + if (ref->getType() == df::general_ref_type::UNIT_HOLDER) { c->con.printerr("Choosing not to destroy items in unit inventory.\n"); return CR_FAILURE; diff --git a/plugins/workflow.cpp b/plugins/workflow.cpp index 4a3564d65..7556ca944 100644 --- a/plugins/workflow.cpp +++ b/plugins/workflow.cpp @@ -977,7 +977,7 @@ static void dryBucket(df::item *item) for (unsigned i = 0; i < item->itemrefs.size(); i++) { df::general_ref *ref = item->itemrefs[i]; - if (ref->getType() == df::general_ref_type::contains_item) + if (ref->getType() == df::general_ref_type::CONTAINS_ITEM) { df::item *obj = ref->getItem(); @@ -999,20 +999,20 @@ static bool itemBusy(df::item *item) for (unsigned i = 0; i < item->itemrefs.size(); i++) { df::general_ref *ref = item->itemrefs[i]; - if (ref->getType() == df::general_ref_type::contains_item) + if (ref->getType() == df::general_ref_type::CONTAINS_ITEM) { df::item *obj = ref->getItem(); if (obj && !obj->flags.bits.garbage_colect) return true; } - else if (ref->getType() == df::general_ref_type::contains_unit) + else if (ref->getType() == df::general_ref_type::CONTAINS_UNIT) return true; - else if (ref->getType() == df::general_ref_type::unit_holder) + else if (ref->getType() == df::general_ref_type::UNIT_HOLDER) { if (!item->flags.bits.in_job) return true; } - else if (ref->getType() == df::general_ref_type::contained_in_item) + else if (ref->getType() == df::general_ref_type::CONTAINED_IN_ITEM) { df::item *obj = ref->getItem(); if (!obj)