MCPcopy Create free account
hub / github.com/DFHack/dfhack / check_lost_jobs

Function check_lost_jobs

plugins/workflow.cpp:550–585  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

548}
549
550static void check_lost_jobs(color_ostream &out, int ticks)
551{
552 ProtectedJob::cur_tick_idx++;
553 if (ticks < 0) ticks = 0;
554
555 df::job_list_link *p = world->jobs.list.next;
556 for (; p; p = p->next)
557 {
558 df::job *job = p->item;
559
560 ProtectedJob *pj = get_known(job->id);
561 if (pj)
562 {
563 if (!job->flags.bits.repeat)
564 forget_job(out, pj);
565 else
566 pj->tick_job(job, ticks);
567 }
568 else if (job->flags.bits.repeat && isSupportedJob(job))
569 {
570 pj = new ProtectedJob(job);
571 assert(pj->holder);
572 known_jobs[pj->id] = pj;
573 }
574 }
575
576 for (TKnownJobs::const_iterator it = known_jobs.begin(); it != known_jobs.end(); ++it)
577 {
578 if (it->second->tick_idx == ProtectedJob::cur_tick_idx ||
579 !it->second->isLive())
580 continue;
581
582 it->second->actual_job = NULL;
583 pending_recover.push_back(it->second);
584 }
585}
586
587static void update_job_data(color_ostream &out)
588{

Callers 3

start_protectFunction · 0.85
update_data_structuresFunction · 0.85

Calls 7

get_knownFunction · 0.85
forget_jobFunction · 0.85
isSupportedJobFunction · 0.85
tick_jobMethod · 0.80
isLiveMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected