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

Function jobCompletedHandler

plugins/burrow.cpp:193–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193static void jobCompletedHandler(color_ostream& out, void* ptr) {
194 DEBUG(event, out).print("entering jobCompletedHandler\n");
195
196 df::job *job = (df::job *)ptr;
197 auto type = ENUM_ATTR(job_type, type, job->job_type);
198 if (type != job_type_class::Digging)
199 return;
200
201 const df::coord &pos = job->pos;
202 DEBUG(event, out).print("dig job completed: id={}, pos=({}, {}, {}), type={}\n",
203 job->id, pos.x, pos.y, pos.z, ENUM_KEY_STR(job_type, job->job_type));
204
205 df::tiletype prev_tt = active_dig_jobs[pos];
206 df::tiletype *tt = Maps::getTileType(pos);
207
208 if (tt && *tt && *tt != prev_tt)
209 expand_burrows(out, pos, prev_tt, *tt);
210
211 active_dig_jobs.erase(pos);
212}
213
214/////////////////////////////////////////////////////
215// Lua API

Callers

nothing calls this directly

Calls 4

getTileTypeFunction · 0.85
expand_burrowsFunction · 0.85
printMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected