diff --git a/plugins/autodump.cpp b/plugins/autodump.cpp index 109253dc5..5fc9adfc2 100644 --- a/plugins/autodump.cpp +++ b/plugins/autodump.cpp @@ -338,7 +338,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 (strict_virtual_cast(ref)) + 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 38e2313cd..104604ce6 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 (strict_virtual_cast(ref)) + 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 (strict_virtual_cast(ref)) + 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 (strict_virtual_cast(ref)) + else if (ref->getType() == df::general_ref_type::contains_unit) return true; - else if (strict_virtual_cast(ref)) + else if (ref->getType() == df::general_ref_type::unit_holder) { if (!item->flags.bits.in_job) return true; } - else if (strict_virtual_cast(ref)) + else if (ref->getType() == df::general_ref_type::contained_in_item) { df::item *obj = ref->getItem(); if (!obj)