private IEnumerable <Act.Status> Cleanup(CreatureAI creature) { if (creature.Blackboard.GetData <bool>("NoPath", false)) { creature.SetTaskFailureReason("Failed to plant. Task was unreachable."); yield return(Act.Status.Fail); yield break; } yield return(Act.Status.Success); }
public IEnumerable <Act.Status> PenAnimal(CreatureAI agent, CreatureAI creature, AnimalPen animalPen) { foreach (var status in animalPen.AddAnimal(Animal.Physics, agent.World)) { if (status == Act.Status.Fail) { creature.ResetPositionConstraint(); agent.SetTaskFailureReason("Failed to pen animal."); yield return(Act.Status.Fail); yield break; } } yield return(Act.Status.Success); }