RimWorld

RimWorld

[LTS]Maintenance
SlippyCheeze 5. juli 2022 kl. 0:59
incompatibility, possibly due to workgiver bug, with HousekeeperAssistanceCat
In re this discussion: https://psteamcommunity.yuanyoumao.com/workshop/filedetails/discussion/1541620640/3416558908200170526/?tscn=1656975879

The HousekeeperAssistanceCat mod has a custom JobGiver that (apparently deliberately) didn't call the `ShouldSkip` method on the WorkGiver.

For Maintenance workgivers, this returns a job that consumes the repair toolkit, but achieves nothing. While I'm pretty sure this is incorrect behaviour on the part of the other mod, it seems like most custom WorkGivers *also* implement that they return `(Job)null` from `JobOnThing` if the job doesn't apply.

Implementation would be roughly:
public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { if (ShouldSkip(pawn, forced)) { return null; } // ...the rest of the current WorkGiver }

YMMV how you want to handle this. I'm hoping the HousekeeperAssistanceCat author will correctly call ShouldSkip, though, which should be is the right solution.
< >
Viser 1-3 af 3 kommentarer
LimeTreeSnake  [udvikler] 13. juli 2022 kl. 1:33 
Hmmm, I wonder how I would go about fixing that as it seems counter intuitive make my code check if animals and whatnot are doing the task or not as this is a task given to all colonists using the colonist thinktree.
SlippyCheeze 13. juli 2022 kl. 6:36 
I think just returning (Job)null if ShouldSkip() in JobOnThing is the right "fix" in your code, because the core Verse/RimWorld code does that. Beyond that, I think it is a bug in the housekeeper cat custom workgiver, and you should just ignore it.

Returning a null job avoids wasting repair kits in the face of unexpected job creation, though, which is a bonus.
Esterior 1. sep. 2022 kl. 15:42 
It also doesn't work with Anicent Worker Drone from Reinforced Mechanoids
< >
Viser 1-3 af 3 kommentarer
Per side: 1530 50