// duplicated to make changes public bool IsValidStorageFor(IntVec3 c, Thing storable) { // call duplicated to make changes if (!WorkGiver_HaulGeneral.NoStorageBlockersIn(c, storable)) { return(false); } SlotGroup slotGroup = c.GetSlotGroup(); return(slotGroup != null && slotGroup.Settings.AllowedToAccept(storable)); }
public static void Check(Thing t) { if (WorkGiver_HaulGeneral.ShouldBeHaulable(t)) { if (!haulables.Contains(t)) { haulables.Add(t); } } else { if (haulables.Contains(t)) { haulables.Remove(t); } } }
// duplicated to make changes public Toil PlaceHauledThingInCell(TargetIndex cellInd, Toil nextToilOnPlaceFailOrIncomplete, bool storageMode) { Toil toil = new Toil(); toil.initAction = delegate { Pawn actor = toil.actor; Job curJob = actor.jobs.curJob; IntVec3 cell = curJob.GetTarget(cellInd).Cell; SlotGroup slotGroup = Find.SlotGroupManager.SlotGroupAt(cell); if (slotGroup != null && slotGroup.Settings.AllowedToAccept(actor.carrier.CarriedThing)) { Find.DesignationManager.RemoveAllDesignationsOn(actor.carrier.CarriedThing, false); } Thing thing; // call duplicated to make changes if (TryDropCarriedThing(actor, cell, ThingPlaceMode.Direct, out thing)) { if (curJob.def == JobDefOf.DoBill && thing != null) { if (curJob.placedTargets == null) { curJob.placedTargets = new List <TargetInfo>(); } if (!curJob.placedTargets.Contains(thing)) { curJob.placedTargets.Add(thing); } } } else if (storageMode) { IntVec3 vec; // call duplicated to make changes if (nextToilOnPlaceFailOrIncomplete != null && WorkGiver_HaulGeneral.TryFindBestBetterStoreCellFor(actor.carrier.CarriedThing, actor, StoragePriority.Unstored, actor.Faction, out vec, true)) { actor.CurJob.SetTarget(cellInd, vec); actor.jobs.curDriver.SetNextToil(nextToilOnPlaceFailOrIncomplete); return; } Job job = HaulAIUtility.HaulAsideJobFor(actor, actor.carrier.CarriedThing); if (job != null) { curJob.targetA = job.targetA; curJob.targetB = job.targetB; curJob.targetC = job.targetC; curJob.maxNumToCarry = job.maxNumToCarry; curJob.haulOpportunisticDuplicates = job.haulOpportunisticDuplicates; curJob.haulMode = job.haulMode; actor.jobs.curDriver.JumpToToil(nextToilOnPlaceFailOrIncomplete); } else { Log.Error(string.Concat(new object[] { "Incomplete haul for ", actor, ": Could not find anywhere to put ", actor.carrier.CarriedThing, " near ", actor.Position, ". Destroying. actor.carrier should never happen!" })); actor.carrier.CarriedThing.Destroy(DestroyMode.Vanish); } } else if (nextToilOnPlaceFailOrIncomplete != null) { actor.jobs.curDriver.SetNextToil(nextToilOnPlaceFailOrIncomplete); return; } }; return(toil); }