Implements plugin: channel-safely v0.3

develop
Josh Cooper 2022-11-06 12:04:01 -08:00
parent 3a6205d19e
commit b7ee01108e
1 changed files with 23 additions and 26 deletions

@ -209,9 +209,8 @@ namespace CSP {
} }
void JobCompletedEvent(color_ostream &out, void* job_ptr) { void JobCompletedEvent(color_ostream &out, void* job_ptr) {
if (config.monitor_active) {
INFO(monitor).print("JobCompletedEvent()\n");
if (enabled && World::isFortressMode() && Maps::IsValid()) { if (enabled && World::isFortressMode() && Maps::IsValid()) {
INFO(monitor).print("JobCompletedEvent()\n");
auto job = (df::job*) job_ptr; auto job = (df::job*) job_ptr;
// we only care if the job is a channeling one // we only care if the job is a channeling one
if (is_dig_job(job)) { if (is_dig_job(job)) {
@ -234,8 +233,6 @@ namespace CSP {
ChannelManager::Get().mark_done(job->pos); ChannelManager::Get().mark_done(job->pos);
ChannelManager::Get().manage_group(below); ChannelManager::Get().manage_group(below);
ChannelManager::Get().debug(); ChannelManager::Get().debug();
Job::removeJob(job);
}
} }
} }
INFO(monitor).print("JobCompletedEvent() exits\n"); INFO(monitor).print("JobCompletedEvent() exits\n");