In the Droids mod I had an issue where Droids were mysteriously taking damage. This can be fixed by putting <diet>NeverEats</diet> in the RaceDef. However, when I do this the PawnGenerator won't create a food tracker:
This is fine, unless the pawn goes below max health, in which case the following check (done twice) in Pawn_HealthTracker.HealthTick() dereferences the null pointer pawn.food:
Which seems to stop it from functioning altogether. I'm working on a work around but seems like a null check would be in order.
Code Select
if (pawn.RaceDef.EatsFood)
{
pawn.food = new Pawn_FoodTracker (pawn);
}
This is fine, unless the pawn goes below max health, in which case the following check (done twice) in Pawn_HealthTracker.HealthTick() dereferences the null pointer pawn.food:
Code Select
if (!this.pawn.food.Food.Starving)
Which seems to stop it from functioning altogether. I'm working on a work around but seems like a null check would be in order.