Fix loop in Designations::unmarkPlant()

develop
lethosor 2017-05-05 17:24:51 -04:00
parent b92cb6dcdb
commit adb14491d0
1 changed files with 5 additions and 5 deletions

@ -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;
}