Ejemplo n.º 1
0
        public static ThoughtState CurrentStateInternal(RimWorld.ThoughtWorker_BarracksImpressiveness _this, Pawn p)
        {
            if (p == null)
            {
                return(ThoughtState.Inactive);                                                             // Added
            }
            ThoughtState result = ThoughtWorker_SleepingRoomImpressiveness.CurrentStateInternal(_this, p); // Had to change

            if (!result.Active)
            {
                return(ThoughtState.Inactive);                // Changed
            }
            #region Added
            if (p.IsGuest())
            {
                var room = p.GetGuestRoom();
                if (room != null && room.Role == RoomRoleDefOf.Barracks)
                {
                    return(result);
                }
                return(ThoughtState.Inactive);
            }
            #endregion

            // BASE
            if (p.ownership.OwnedBed.GetRoom().Role == RoomRoleDefOf.Barracks)
            {
                return(result);
            }
            return(ThoughtState.Inactive);
        }
        public static ThoughtState CurrentStateInternal(RimWorld.ThoughtWorker_PrisonCellImpressiveness _this, Pawn p)
        {
            if (p == null || p.ownership == null || p.ownership.OwnedBed == null) return ThoughtState.Inactive; // Added
            ThoughtState result = ThoughtWorker_SleepingRoomImpressiveness.CurrentStateInternal(_this, p); // Had to change

            // BASE
            if (result.Active && p.ownership.OwnedBed.GetRoom().Role == RoomRoleDefOf.PrisonCell)
            {
                return result;
            }
            return ThoughtState.Inactive;
        }