|
|
|
@ -148,6 +148,7 @@ namespace CSP {
|
|
|
|
|
|
|
|
|
|
void JobStartedEvent(color_ostream &out, void* p) {
|
|
|
|
|
if (enabled && World::isFortressMode() && Maps::IsValid()) {
|
|
|
|
|
if (config.monitor_active) {
|
|
|
|
|
INFO(monitor).print("JobStartedEvent()\n");
|
|
|
|
|
auto job = (df::job*) p;
|
|
|
|
|
// validate job type
|
|
|
|
@ -206,10 +207,11 @@ namespace CSP {
|
|
|
|
|
INFO(monitor).print(" <- JobStartedEvent() exits normally\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void JobCompletedEvent(color_ostream &out, void* job_ptr) {
|
|
|
|
|
if (enabled && World::isFortressMode() && Maps::IsValid()) {
|
|
|
|
|
INFO(monitor).print("JobCompletedEvent()\n");
|
|
|
|
|
INFO(jobs).print("JobCompletedEvent()\n");
|
|
|
|
|
auto job = (df::job*) job_ptr;
|
|
|
|
|
// we only care if the job is a channeling one
|
|
|
|
|
if (ChannelManager::Get().groups.count(job->pos)) {
|
|
|
|
@ -226,7 +228,7 @@ namespace CSP {
|
|
|
|
|
// the job can be considered done
|
|
|
|
|
df::coord below(job->pos);
|
|
|
|
|
below.z--;
|
|
|
|
|
WARN(monitor).print(" -> Marking tile done and managing the group below.\n");
|
|
|
|
|
WARN(jobs).print(" -> Marking tile done and managing the group below.\n");
|
|
|
|
|
// mark done and manage below
|
|
|
|
|
block->designation[Coord(local)].bits.traffic = df::tile_traffic::Normal;
|
|
|
|
|
ChannelManager::Get().mark_done(job->pos);
|
|
|
|
|