static void Postfix(JobDriver_Mounted __instance, ref bool __result)
        {
            ExtendedDataStorage store = Base.Instance.GetExtendedDataStorage();

            if (store == null)
            {
                __result = true;
                return;
            }
            ExtendedPawnData pawnData = store.GetExtendedDataFor(__instance.pawn);

            if (pawnData.targetJob == null)
            {
                __result = true;
                return;
            }
            __result = ReserveUtility.ReserveEveryThingOfJob(pawnData.targetJob, __instance);
        }
Example #2
0
        public override bool TryMakePreToilReservations(bool errorOnFailed)
        {
            //For automatic mounting, reserve the mount aswell as targets of the job the pawn is riding to (target B and possibly C).

            bool result = true;

            ExtendedDataStorage store = Base.Instance.GetExtendedDataStorage();

            if (store == null)
            {
                return(true);
            }
            ExtendedPawnData pawnData = store.GetExtendedDataFor(this.pawn);

            if (pawnData.targetJob == null)
            {
                return(true);
            }
            result             = ReserveUtility.ReserveEveryThingOfJob(pawnData.targetJob, this);
            pawnData.targetJob = null;
            return(result);
        }