Skip to content

Commit

Permalink
Methods now check for 'StartsWith [DefName]' instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Two-Kay committed Oct 20, 2020
1 parent ed5bad4 commit f8019fd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
Binary file modified Assemblies/Plushies.dll
Binary file not shown.
Binary file modified Source/Plushies/.vs/Plushies/v16/.suo
Binary file not shown.
3 changes: 2 additions & 1 deletion Source/Plushies/HarmonyPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ static void Postfix(Pawn actor)
if (comp == null)
return;

var hasPlushie = comp.LinkedFacilitiesListForReading.Any(thing => thing.def.defName == "Plushie");
//var hasPlushie = comp.LinkedFacilitiesListForReading.Any(thing => thing.def.defName == "Plushie");
var hasPlushie = comp.LinkedFacilitiesListForReading.Any(thing => thing.def.defName.StartsWith("Plushie"));
if (hasPlushie) {
if (actor.story != null && actor.story.traits != null && actor.story.traits.HasTrait(TraitDefOf.Kind)) {
actor.needs.mood.thoughts.memories.TryGainMemory(PlushiesThoughtDefOf.PlushieCuddleKind);
Expand Down
3 changes: 2 additions & 1 deletion Source/Plushies/JoyGiver_CuddlePlushie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public override Job TryGiveJob(Pawn pawn)
Log.Error("No CompArt on thing being considered for viewing: " + thing, false);
return false;
}
if (thing.def.defName != "Plushie")
//if (thing.def.defName != "Plushie")
if (thing.def.defName.StartsWith("Plushie") == false)
{
return false;
}
Expand Down

0 comments on commit f8019fd

Please sign in to comment.