|
|
@ -199,13 +199,15 @@ namespace CSP {
|
|
|
|
INFO(jobs).print("JobStartedEvent()\n");
|
|
|
|
INFO(jobs).print("JobStartedEvent()\n");
|
|
|
|
auto job = (df::job*) j;
|
|
|
|
auto job = (df::job*) j;
|
|
|
|
// validate job type
|
|
|
|
// validate job type
|
|
|
|
if (is_channel_job(job)) {
|
|
|
|
if (ChannelManager::Get().exists(job->pos)) {
|
|
|
|
DEBUG(jobs).print(" valid channel job:\n");
|
|
|
|
WARN(jobs).print(" valid channel job:\n");
|
|
|
|
df::unit* worker = Job::getWorker(job);
|
|
|
|
df::unit* worker = Job::getWorker(job);
|
|
|
|
// there is a valid worker (living citizen) on the job? right..
|
|
|
|
// there is a valid worker (living citizen) on the job? right..
|
|
|
|
if (worker && Units::isAlive(worker) && Units::isCitizen(worker)) {
|
|
|
|
if (worker && Units::isAlive(worker) && Units::isCitizen(worker)) {
|
|
|
|
DEBUG(jobs).print(" valid worker:\n");
|
|
|
|
DEBUG(jobs).print(" valid worker:\n");
|
|
|
|
// track workers on jobs
|
|
|
|
// track workers on jobs
|
|
|
|
|
|
|
|
df::coord &pos = job->pos;
|
|
|
|
|
|
|
|
WARN(jobs).print(" -> Starting job at (" COORD ")\n", COORDARGS(pos));
|
|
|
|
if (config.monitor_active || config.resurrect) {
|
|
|
|
if (config.monitor_active || config.resurrect) {
|
|
|
|
job_ids.emplace(job, job->id);
|
|
|
|
job_ids.emplace(job, job->id);
|
|
|
|
active_jobs.emplace(job->id, job);
|
|
|
|
active_jobs.emplace(job->id, job);
|
|
|
@ -225,7 +227,7 @@ namespace CSP {
|
|
|
|
INFO(jobs).print("JobCompletedEvent()\n");
|
|
|
|
INFO(jobs).print("JobCompletedEvent()\n");
|
|
|
|
auto job = (df::job*) j;
|
|
|
|
auto job = (df::job*) j;
|
|
|
|
// we only care if the job is a channeling one
|
|
|
|
// we only care if the job is a channeling one
|
|
|
|
if (ChannelManager::Get().groups.count(job->pos)) {
|
|
|
|
if (ChannelManager::Get().exists(job->pos)) {
|
|
|
|
// check job outcome
|
|
|
|
// check job outcome
|
|
|
|
auto block = Maps::getTileBlock(job->pos);
|
|
|
|
auto block = Maps::getTileBlock(job->pos);
|
|
|
|
df::coord local(job->pos);
|
|
|
|
df::coord local(job->pos);
|
|
|
@ -246,7 +248,7 @@ namespace CSP {
|
|
|
|
// the tile is unchanged
|
|
|
|
// the tile is unchanged
|
|
|
|
df::unit* worker = active_workers[job->id];
|
|
|
|
df::unit* worker = active_workers[job->id];
|
|
|
|
endangered_workers.emplace(active_workers[job->id]);
|
|
|
|
endangered_workers.emplace(active_workers[job->id]);
|
|
|
|
ERR(jobs).print(" -> (" COORD ") stopped working but (" COORD ") doesn't appear done.\n",COORDARGS(worker->pos), COORDARGS(job->pos));
|
|
|
|
ERR(jobs).print("() -> job at (" COORD ") is done, but (" COORD ") doesn't appear done.\n",COORDARGS(worker->pos), COORDARGS(job->pos));
|
|
|
|
if (config.insta_dig) {
|
|
|
|
if (config.insta_dig) {
|
|
|
|
dignow_queue.emplace(job->pos);
|
|
|
|
dignow_queue.emplace(job->pos);
|
|
|
|
}
|
|
|
|
}
|
|
|
|