Skip to content

Commit

Permalink
Deleted log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Two-Kay committed Dec 10, 2022
1 parent ee3cbb3 commit 3b0fd1f
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions Source/Plushies/HarmonyPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,32 +77,24 @@ class BedThoughtsPatch
{
static void Postfix(Pawn actor)
{
Log.Message("BedThoughtsPatch");
// These are here since it seems hard to figure out what properties in Rimworld
// are actually nullable
if (actor.needs == null || actor.needs.mood == null || actor.needs.mood.thoughts == null ||
actor.needs.mood.thoughts.memories == null)
return;

Log.Message("Has memories");

var bed = actor.CurrentBed();
if (bed == null)
return;

Log.Message("Has bed");

// This can be null in the case of a sleeping spot
var comp = bed.GetComp<CompAffectedByFacilities>();
if (comp == null)
return;

Log.Message("Has comp");

//var hasPlushie = comp.LinkedFacilitiesListForReading.Any(thing => thing.def.defName == "Plushie");
var hasPlushie = comp.LinkedFacilitiesListForReading.Any(thing => thing.def.defName.StartsWith("Plushie"));
if (hasPlushie) {
Log.Message("Has plushie");
if (actor.story != null && actor.story.traits != null && actor.story.traits.HasTrait(TraitDefOf.Kind)) {
if (!actor.ageTracker.Adult) {
actor.needs.mood.thoughts.memories.TryGainMemory(PlushiesThoughtDefOf.PlushieCuddleChildKind);
Expand Down

0 comments on commit 3b0fd1f

Please sign in to comment.