コード例 #1
0
        //public override void SpawnSetup(Map map, bool respawningAfterLoad)
        public static void Postfix(Pawn __instance, Map map, bool respawningAfterLoad)
        {
            if (respawningAfterLoad)
            {
                return;
            }

            if (map?.IsPlayerHome ?? false)
            {
                if (HomeBedComp.Get(__instance, out Building_Bed homeBed) &&
                    homeBed?.Map == map && !homeBed.ForPrisoners &&
                    (Settings.Get().reclaimAggresively || RestUtility.IsValidBedFor(homeBed, __instance, __instance, false, true)))
                {
                    Log.Message($"Re-claming Home bed {homeBed} for {__instance}");
                    __instance.ownership?.ClaimBedIfNonMedical(homeBed);
                }
                Log.Message($"Removing Home beds for {__instance}");
                HomeBedComp.Remove(__instance);
            }
        }
コード例 #2
0
 public static void Prefix(Building_Bed __instance)
 {
     Log.Message($"Removing {__instance}");
     HomeBedComp.Remove(__instance);
 }