public override void DoAction(Transition trans)
        {
            LordToil_Travel lordToil_Travel = (LordToil_Travel)trans.target;

            if (!lordToil_Travel.HasDestination())
            {
                Pawn pawn = lordToil_Travel.lord.ownedPawns.RandomElement();
                if (!CellFinder.TryFindRandomPawnExitCell(pawn, out var result))
                {
                    RCellFinder.TryFindRandomPawnEntryCell(out result, pawn.Map, 0f);
                }
                lordToil_Travel.SetDestination(result);
            }
        }
Esempio n. 2
0
        public override void DoAction(Transition trans)
        {
            LordToil_Travel lordToil_Travel = (LordToil_Travel)trans.target;

            if (!lordToil_Travel.HasDestination())
            {
                Pawn    pawn        = lordToil_Travel.lord.ownedPawns.RandomElement();
                IntVec3 destination = default(IntVec3);
                if (!CellFinder.TryFindRandomPawnExitCell(pawn, out destination))
                {
                    RCellFinder.TryFindRandomPawnEntryCell(out destination, pawn.Map, 0f, (Predicate <IntVec3>)null);
                }
                lordToil_Travel.SetDestination(destination);
            }
        }
        public override void DoAction(Transition trans)
        {
            LordToil_Travel lordToil_Travel = (LordToil_Travel)trans.target;

            if (lordToil_Travel.HasDestination())
            {
                return;
            }
            Pawn    pawn = lordToil_Travel.lord.ownedPawns.RandomElement <Pawn>();
            IntVec3 destination;

            if (!CellFinder.TryFindRandomPawnExitCell(pawn, out destination))
            {
                RCellFinder.TryFindRandomPawnEntryCell(out destination, pawn.Map, 0f, null);
            }
            lordToil_Travel.SetDestination(destination);
        }