| 191 | } |
| 192 | |
| 193 | static 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 |
nothing calls this directly
no test coverage detected