public override void Destroy(DestroyMode mode = DestroyMode.Vanish) { bool spawned = base.Spawned; Map map = base.Map; base.Destroy(mode); if (InnerThing == null) { return; } InstallBlueprintUtility.CancelBlueprintsFor(this); if (spawned) { switch (mode) { case DestroyMode.Deconstruct: SoundDefOf.Building_Deconstructed.PlayOneShot(new TargetInfo(base.Position, map)); GenLeaving.DoLeavingsFor(InnerThing, map, mode, this.OccupiedRect()); break; case DestroyMode.KillFinalize: GenLeaving.DoLeavingsFor(InnerThing, map, mode, this.OccupiedRect()); break; } } if (InnerThing is MonumentMarker) { InnerThing.Destroy(); } }
public override void Destroy(DestroyMode mode = DestroyMode.Vanish) { bool spawned = base.Spawned; Map map = base.Map; base.Destroy(mode); if (this.InnerThing != null) { InstallBlueprintUtility.CancelBlueprintsFor(this); if (mode == DestroyMode.Deconstruct && spawned) { SoundDef.Named("BuildingDeconstructed").PlayOneShot(new TargetInfo(base.Position, map, false)); GenLeaving.DoLeavingsFor(this.InnerThing, map, mode, this.OccupiedRect()); } } }
public static void DoLeavingsFor(Thing diedThing, Map map, DestroyMode mode) { GenLeaving.DoLeavingsFor(diedThing, map, mode, diedThing.OccupiedRect(), null); }