public bool IsPawnSleeping() { if (CurOccupants?.RandomElement() != null) { return(true); } return(false); }
public bool IsPawnSleeping() { if (CurOccupants != null && CurOccupants.EnumerableCount() > 0) { return(true); } return(false); }
public override void Tick() { base.Tick(); if (Occupied) { if (CurOccupants.Count() > 0) { foreach (Pawn p in CurOccupants) { if (p.RaceProps.Humanlike) { this.def.building.bed_showSleeperBody = false; } if (!p.health.hediffSet.HasHediff(XenomorphDefOf.RRY_Hediff_Cocooned)) { p.health.AddHediff(XenomorphDefOf.RRY_Hediff_Cocooned); } if (p.Dead) { this.Destroy(); } } } } else { List <IntVec3> celllist = this.CellsAdjacent8WayAndInside().ToList(); if (!celllist.NullOrEmpty()) { foreach (var cell in celllist) { if (cell.GetFirstPawn(this.Map) != null && cell.GetFirstPawn(this.Map) is Pawn p) { if (p.Downed && !p.Dead && !p.InBed() && !(p.kindDef.race.defName.Contains("RRY_Xenomorph_"))) { p.jobs.Notify_TuckedIntoBed(this); p.mindState.Notify_TuckedIntoBed(); } } } } else if (!Occupied) { this.def.building.bed_showSleeperBody = true; } this.Destroy(); } }