Skip to content

Commit

Permalink
Handle recycle output better
Browse files Browse the repository at this point in the history
  • Loading branch information
notfood committed Nov 28, 2018
1 parent 7b46a36 commit e05ef86
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Binary file modified Assemblies/MendAndRecycle.dll
Binary file not shown.
14 changes: 9 additions & 5 deletions Source/JobDriver_Recycle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,22 @@ protected override Toil DoBill ()
Log.Error ("MendAndRecycle :: " + pawn + " could not drop recipe product " + list [j] + " near " + pawn.Position);
}
}
} else if (list.Count == 1) {
}

if (list.Count >= 1) {
list [0].SetPositionDirect (pawn.Position);

job.bill.Notify_IterationCompleted (pawn, list);
job.targetB = list [0];
job.SetTarget(IngredientInd, list[0]);

pawn.Map.reservationManager.Reserve (pawn, job, job.GetTarget(IngredientInd), 1);

pawn.Map.reservationManager.Reserve (pawn, job, job.targetB, 1);
ReadyForNextToil();
} else {
Log.Message ("MendAndRecycle :: " + pawn + " could not reclaim anything from " + objectThing);
}

ReadyForNextToil ();
pawn.jobs.EndCurrentJob(JobCondition.Succeeded);
}
}

workCycleProgress = workCycle;
Expand Down

0 comments on commit e05ef86

Please sign in to comment.