diff --git a/library/modules/Items.cpp b/library/modules/Items.cpp index 4939aa9dd..4b6010718 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->data.VERMIN_ESCAPED_PET->pos; + return ref->data.vermin->pos; default: break; diff --git a/library/modules/Job.cpp b/library/modules/Job.cpp index d0487941f..0aa01af95 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->data.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->data.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/modules/Units.cpp b/library/modules/Units.cpp index fa7007574..313d6ee9f 100644 --- a/library/modules/Units.cpp +++ b/library/modules/Units.cpp @@ -204,13 +204,13 @@ void Units::setNickname(df::unit *unit, std::string nick) df::historical_figure *id_hfig = NULL; switch (identity->type) { - case df::identity_type::Hiding_Curse: + case df::identity_type::HidingCurse: case df::identity_type::Identity: - case df::identity_type::False_Identity: + case df::identity_type::FalseIdentity: break; // We want the nickname to end up in the identity case df::identity_type::Unk_1: // Guess, but that's how it worked in the past - case df::identity_type::True_Name: + case df::identity_type::TrueName: case df::identity_type::Unk_4: // Pure guess, as this is a new case, still unseen id_hfig = df::historical_figure::find(identity->histfig_nemesis_id); break; @@ -258,7 +258,7 @@ bool Units::isHidingCurse(df::unit *unit) if (!unit->job.hunt_target) { auto identity = Units::getIdentity(unit); - if (identity && identity->type == df::identity_type::Hiding_Curse) + if (identity && identity->type == df::identity_type::HidingCurse) return true; } diff --git a/plugins/orders.cpp b/plugins/orders.cpp index f600b0cd0..045c07a1f 100644 --- a/plugins/orders.cpp +++ b/plugins/orders.cpp @@ -798,13 +798,13 @@ static command_result orders_clear_command(color_ostream & out) { delete condition; } - if (order->anon_1) + if (order->items) { - for (auto anon_1 : *order->anon_1) + for (auto anon_1 : *order->items) { delete anon_1; } - delete order->anon_1; + delete order->items; } delete order; diff --git a/plugins/stocks.cpp b/plugins/stocks.cpp index d9ec97c0d..af49dcb2a 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->data.JOB) - return ref->data.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->data.JOB) + if (ref && ref->data.job) { - if (ref->data.JOB->job_type == job_type::Eat || ref->data.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->data.JOB); + auto unit = Job::getWorker(ref->data.job); if (unit) return unit->pos; } diff --git a/plugins/workflow.cpp b/plugins/workflow.cpp index 3e31d14ab..600a8bef1 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->data.JOB) + if (!ref || !ref->data.job) return true; - return ENUM_ATTR(job_type, type, ref->data.JOB->job_type) + return ENUM_ATTR(job_type, type, ref->data.job->job_type) != job_type_class::Hauling; }