Really loving this mod. I noticed that the Crematorius shouldn't target animals you hunt though.
Here's how you fix it.
JobGiver_GetCorpses.cs
Here's how you fix it.
JobGiver_GetCorpses.cs
Code Select
using MechanicalDefence2.Util;
using RimWorld;
using System;
using Verse;
using Verse.AI;
namespace MechanicalDefence2.Droids
{
public class JobGiver_GetCorpses : ThinkNode_JobGiver
{
protected override Job TryGiveTerminalJob(Pawn pawn)
{
Job result;
if (pawn.GetType() == typeof(Crematorius))
{
Crematorius crematorius = (Crematorius)pawn;
if (crematorius.Active)
{
Corpse corpse = (Corpse)CorpseFinderUtility.FindClosestCorpse(crematorius);
if (corpse != null)
{
if (corpse.innerPawn.RaceProps.humanoid == true)
{
result = new Job(DroidJobDefs.CremateJob, corpse);
return result;
}
else if (corpse.innerPawn.RaceProps.IsAnimal)
{
CompRottable comp = corpse.GetComp<CompRottable>();
if (comp != null && comp.Stage != RotStage.Fresh)
{
result = new Job(DroidJobDefs.CremateJob, corpse);
return result;
}
}
}
}
}
result = null;
return result;
}
}
}