From adb14491d014e6a5d5d608bd19090f556e6429ef Mon Sep 17 00:00:00 2001 From: lethosor Date: Fri, 5 May 2017 17:24:51 -0400 Subject: [PATCH] Fix loop in Designations::unmarkPlant() --- library/modules/Designations.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/modules/Designations.cpp b/library/modules/Designations.cpp index 8cae35d78..87b935cc3 100644 --- a/library/modules/Designations.cpp +++ b/library/modules/Designations.cpp @@ -100,12 +100,12 @@ bool Designations::unmarkPlant(const df::plant *plant) auto *next = link->next; df::job *job = link->item; - if (!job) - continue; - if (job->job_type != job_type::FellTree && job->job_type != job_type::GatherPlants) - continue; - if (job->pos == plant->pos) + if (job && + (job->job_type == job_type::FellTree || job->job_type == job_type::GatherPlants) && + job->pos == plant->pos) + { Job::removeJob(job); + } link = next; }