diff --git a/library/Types.cpp b/library/Types.cpp index 5067c32ae..420f3b866 100644 --- a/library/Types.cpp +++ b/library/Types.cpp @@ -127,7 +127,7 @@ bool DFHack::removeRef(std::vector &vec, df::specific_ref_typ for (int i = vec.size()-1; i >= 0; i--) { df::specific_ref *ref = vec[i]; - if (ref->type != type || ref->object != ptr) + if (ref->type != type || ref->data.object != ptr) continue; vector_erase_at(vec, i); diff --git a/library/modules/Items.cpp b/library/modules/Items.cpp index a1b4ace4d..4939aa9dd 100644 --- a/library/modules/Items.cpp +++ b/library/modules/Items.cpp @@ -658,7 +658,7 @@ df::coord Items::getPosition(df::item *item) switch (ref->type) { case specific_ref_type::VERMIN_ESCAPED_PET: - return ref->vermin->pos; + return ref->data.VERMIN_ESCAPED_PET->pos; default: break; diff --git a/library/modules/Job.cpp b/library/modules/Job.cpp index 7673737b2..d0487941f 100644 --- a/library/modules/Job.cpp +++ b/library/modules/Job.cpp @@ -311,7 +311,7 @@ void DFHack::Job::disconnectJobItem(df::job *job, df::job_item_ref *ref) { auto ref = item->specific_refs[refIndex]; if (ref->type == df::specific_ref_type::JOB) { - if (ref->job == job) { + if (ref->data.JOB == job) { vector_erase_at(item->specific_refs, refIndex); delete ref; } else { @@ -579,7 +579,7 @@ bool DFHack::Job::attachJobItem(df::job *job, df::item *item, auto item_link = new df::specific_ref(); item_link->type = specific_ref_type::JOB; - item_link->job = job; + item_link->data.JOB = job; item->specific_refs.push_back(item_link); auto job_link = new df::job_item_ref(); diff --git a/library/xml b/library/xml index 5653a57e0..61eed9280 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 5653a57e0978a78c1f1ef125b63359fefa7660f2 +Subproject commit 61eed9280adfb51dde777c9e8f8549a4d72e868b diff --git a/plugins/stocks.cpp b/plugins/stocks.cpp index b5831d159..d9ec97c0d 100644 --- a/plugins/stocks.cpp +++ b/plugins/stocks.cpp @@ -179,8 +179,8 @@ static map items_in_cages; static df::job *get_item_job(df::item *item) { auto ref = Items::getSpecificRef(item, specific_ref_type::JOB); - if (ref && ref->job) - return ref->job; + if (ref && ref->data.JOB) + return ref->data.JOB; return nullptr; } @@ -1008,12 +1008,12 @@ private: if (item->flags.bits.in_job) { auto ref = Items::getSpecificRef(item, specific_ref_type::JOB); - if (ref && ref->job) + if (ref && ref->data.JOB) { - if (ref->job->job_type == job_type::Eat || ref->job->job_type == job_type::Drink) + if (ref->data.JOB->job_type == job_type::Eat || ref->data.JOB->job_type == job_type::Drink) return pos; - auto unit = Job::getWorker(ref->job); + auto unit = Job::getWorker(ref->data.JOB); if (unit) return unit->pos; } diff --git a/plugins/workflow.cpp b/plugins/workflow.cpp index 18490039e..3e31d14ab 100644 --- a/plugins/workflow.cpp +++ b/plugins/workflow.cpp @@ -1151,10 +1151,10 @@ static bool itemInRealJob(df::item *item) return false; auto ref = Items::getSpecificRef(item, specific_ref_type::JOB); - if (!ref || !ref->job) + if (!ref || !ref->data.JOB) return true; - return ENUM_ATTR(job_type, type, ref->job->job_type) + return ENUM_ATTR(job_type, type, ref->data.JOB->job_type) != job_type_class::Hauling; }