angavrilov changed general_ref_type to be all uppercase

develop
Quietust 2012-01-18 08:26:08 -06:00
parent fd653a0227
commit 35ad84c58a
3 changed files with 11 additions and 11 deletions

@ -1,4 +1,4 @@
/* /*
https://github.com/peterix/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com) 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++) for (uint32_t i = 0; i < item->itemrefs.size(); i++)
{ {
df::general_ref *ref = item->itemrefs[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 ref->getID();
} }
return -1; return -1;
@ -441,7 +441,7 @@ int32_t Items::getItemContainerID(const df::item * item)
for (uint32_t i = 0; i < item->itemrefs.size(); i++) for (uint32_t i = 0; i < item->itemrefs.size(); i++)
{ {
df::general_ref *ref = item->itemrefs[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 ref->getID();
} }
return -1; return -1;
@ -449,7 +449,7 @@ int32_t Items::getItemContainerID(const df::item * item)
bool Items::getContainedItems(const df::item * item, std::vector<int32_t> &items) bool Items::getContainedItems(const df::item * item, std::vector<int32_t> &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<int32_t> &values) bool Items::readItemRefs(const df::item * item, df::general_ref_type type, std::vector<int32_t> &values)
@ -471,7 +471,7 @@ bool Items::removeItemOwner(df::item * item, Units *creatures)
for (uint32_t i = 0; i < item->itemrefs.size(); i++) for (uint32_t i = 0; i < item->itemrefs.size(); i++)
{ {
df::general_ref *ref = item->itemrefs[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; continue;
df_unit *unit = (df_unit *)ref->getUnit(); df_unit *unit = (df_unit *)ref->getUnit();

@ -330,7 +330,7 @@ DFhackCExport command_result df_autodump_destroy_item(Core * c, vector <string>
for (unsigned i = 0; i < item->itemrefs.size(); i++) for (unsigned i = 0; i < item->itemrefs.size(); i++)
{ {
df::general_ref *ref = item->itemrefs[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"); c->con.printerr("Choosing not to destroy items in unit inventory.\n");
return CR_FAILURE; return CR_FAILURE;

@ -977,7 +977,7 @@ static void dryBucket(df::item *item)
for (unsigned i = 0; i < item->itemrefs.size(); i++) for (unsigned i = 0; i < item->itemrefs.size(); i++)
{ {
df::general_ref *ref = item->itemrefs[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(); df::item *obj = ref->getItem();
@ -999,20 +999,20 @@ static bool itemBusy(df::item *item)
for (unsigned i = 0; i < item->itemrefs.size(); i++) for (unsigned i = 0; i < item->itemrefs.size(); i++)
{ {
df::general_ref *ref = item->itemrefs[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(); df::item *obj = ref->getItem();
if (obj && !obj->flags.bits.garbage_colect) if (obj && !obj->flags.bits.garbage_colect)
return true; return true;
} }
else if (ref->getType() == df::general_ref_type::contains_unit) else if (ref->getType() == df::general_ref_type::CONTAINS_UNIT)
return true; 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) if (!item->flags.bits.in_job)
return true; 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(); df::item *obj = ref->getItem();
if (!obj) if (!obj)