Exemple #1
0
            static void Postfix(ref List <ThingCount> __result, Pawn healer, Pawn patient, ref int totalCount)
            {
                if (healer.Map != patient.Map)
                {
                    return;
                }

                foreach (Building_InfiniteStorage storage in WorldComp.GetInfiniteStoragesWithinRadius(healer.Map, patient.Position, 20))
                {
                    IEnumerable <Thing> removed = storage.GetMedicalThings(false, true);
                    foreach (Thing r in removed)
                    {
                        List <Thing> dropped = new List <Thing>();
                        BuildingUtil.DropThing(r, r.stackCount, storage, storage.Map, dropped);
                        foreach (Thing t in dropped)
                        {
                            __result.Add(new ThingCount(t, t.stackCount));
                            t.Map.reservationManager.CanReserveStack(healer, t, 1, ReservationLayerDefOf.Floor, true);
                        }
                    }
                }
            }
        private void Dispose()
        {
            try
            {
                this.AllowAdds = false;
                foreach (LinkedList <Thing> l in this.storedThings.Values)
                {
                    foreach (Thing t in l)
                    {
                        BuildingUtil.DropThing(t, t.stackCount, this, this.CurrentMap);
                    }
                }
                this.storedThings.Clear();
            }
            catch (Exception e)
            {
                Log.Error(
                    this.GetType().Name + ".Dispose\n" +
                    e.GetType().Name + " " + e.Message + "\n" +
                    e.StackTrace);
            }

            WorldComp.Remove(this.CurrentMap, this);
        }
 private void DropThing(Thing t, List <Thing> result)
 {
     BuildingUtil.DropThing(t, t.stackCount, this, this.CurrentMap, result);
 }