fluffy-mods / ColonyManager

Colony manager for RimWorld
Other
72 stars 38 forks source link

Division by zero while doing colony management tasks #74

Closed sdp0et closed 7 years ago

sdp0et commented 7 years ago

Edit: this is due to an incompatibility with another mod which is explained in the fourth comment.

I started a new colony and after about a season I started getting errors in the log whenever someone tries to use the manager table. There are many other mods, but no new ones for a the last couple colonies and they did not have this problem.

Since I can't tell when one "management task" starts or ends I can't say for sure if it's on every task or if just certain one(s). It will happen many times in succession (a few seconds between) so it seems it is either multiple tasks or the pawn keeps trying to do the same one that generates the error. Eventually they walk away and I am not able to manually prioritize management, indicating that all the tasks were removed from the queue.

I have not noticed any workbenches not having their managed jobs not getting "refilled", but can't say for certain that no single job is not getting updated by the manager.

I briefly tried a new save and the issue did not occur during the first few days. I have many mods, but since it did not occur in a new save It did not seem worth trying just this one (and the current save wouldn't function properly with them all removed anyway).

If needed, I can provide a save and modsconfig if needed. I thought I'd start with this in case it was something easy.

The stacktrace: Pawn Bones threw exception while executing toil's finish action (0), curJob=ManagingAtManagingStation A=Thing_FM_BasicManagerStation300447: System.DivideByZeroException: Division by zero at FluffyManager.Utilities_Production.CountPerWorker (FluffyManager.ManagerJob_Production job, Int32 workerIndex) [0x00000] in :0 at FluffyManager.ManagerJob_Production.TryDoJob () [0x00000] in :0 at FluffyManager.JobStack.TryDoNextJob () [0x00000] in :0 at FluffyManager.Manager.TryDoWork () [0x00000] in :0 at FluffyManager.JobDriver_ManagingAtManagingStation.b__1_1 () [0x00000] in :0 at Verse.AI.Toil.Cleanup () [0x00000] in :0 Verse.Log:Error(String) Verse.AI.Toil:Cleanup() Verse.AI.JobDriver:TryActuallyStartNextToil() Verse.AI.JobDriver:ReadyForNextToil() Verse.AI.JobDriver:DriverTick() Verse.AI.Pawn_JobTracker:JobTrackerTick() Verse.Pawn:Tick() Verse.TickList:Tick() Verse.TickManager:DoSingleTick() Verse.TickManager:TickManagerUpdate() Verse.Game:Update() Verse.Root_Play:Update()

edit: changed description of frequency as "rapidly" made it sound worse than it actually is.

sdp0et commented 7 years ago

In case it helps: I am currently only using the production, hunting and livestock tabs. In prodcution, I have only 2 non-vanilla jobs: "Cook 4 X meals". These were fine in prior saves. For hunting I have only 2 animals set, both have non-zero numbers in the wild. I have used this tab before, but not in a while. I did have an entry in the livestock tab for animals I no longer had any of. I deleted in and will see if it happens again. Maybe that's the zero?

sdp0et commented 7 years ago

The error occurred again even without the "empty" livestock management item.

sdp0et commented 7 years ago

I just observed a colonist go to the table, sit there for a second then leave. No error. I'm not sure if that means she aborted the task before it occurred or if it means some tasks can complete without it.

sdp0et commented 7 years ago

The problem is with managing jobs for a mending workbench from another mod. If I suspend them in the manager the manager's desk can be used without the error. As soon as they are unsuspended, the next time someone uses the manager's desk the error occurs.

FluffierThanThou commented 7 years ago

thanks for the report! Production is being cut out of the manager for A17, so this is no longer relevant