public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { if (!ShouldTakeCareOfPrisoner(pawn, t)) { return(null); } Pawn prisoner = (Pawn)t; var slaveCollar = (Apparel)pawn.Map.listerThings.ThingsMatching( ThingRequest.ForGroup(ThingRequestGroup.Apparel)).Find(x => SlaveUtility.IsSlaveCollar((Apparel)x) && !x.IsForbidden(pawn.Faction)); if (prisoner.guest.interactionMode != SS_PrisonerInteractionModeDefOf.PIM_Enslave || SlaveUtility.IsPawnColonySlave(pawn) || !pawn.CanReserve(prisoner, 1, -1, null, false) || !pawn.CanReserve(slaveCollar, 1, -1, null, false)) { return(null); } return(slaveCollar != null?JobMaker.MakeJob(SS_JobDefOf.EnslavePrisoner, prisoner, slaveCollar) : null); }
public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { // TODO: Look into this deprecation and see if anything needs to actually change for the new signature (which adds an optional bool) if (!ShouldTakeCareOfPrisoner(pawn, t)) { return(null); } Pawn prisoner = (Pawn)t; var slaveCollar = (Apparel)pawn.Map.listerThings.ThingsMatching( ThingRequest.ForGroup(ThingRequestGroup.Apparel)).Find(x => SlaveUtility.IsSlaveCollar((Apparel)x) && !x.IsForbidden(pawn.Faction)); if (prisoner.guest.interactionMode != SS_PrisonerInteractionModeDefOf.PIM_Enslave || SlaveUtility.IsPawnColonySlave(pawn) || !pawn.CanReserve(prisoner, 1, -1, null, false) || !pawn.CanReserve(slaveCollar, 1, -1, null, false)) { return(null); } return(slaveCollar != null?JobMaker.MakeJob(SS_JobDefOf.EnslavePrisoner, prisoner, slaveCollar) : null); }