Esempio n. 1
0
        public static bool PreFix(ref bool __result, CastPositionRequest newReq, out IntVec3 dest)
        {
            dest = IntVec3.Invalid;
            var caster = newReq.caster;

            if (caster == null || newReq.target is not Pawn pawn)
            {
                return(true);
            }

            var jobs = caster.jobs;

            if (jobs?.curJob != null && CamoAIUtility.JobIsCastException(caster.jobs.curJob.def))
            {
                return(true);
            }

            if (!CamoUtility.IsTargetHidden(pawn, caster))
            {
                return(true);
            }

            __result = false;
            return(false);
        }
        public static bool PreFix(ref bool __result, CastPositionRequest newReq, out IntVec3 dest)
        {
            dest = IntVec3.Invalid;
            Pawn caster = newReq.caster;
            Pawn pawn   = newReq.target as Pawn;

            if (caster != null && pawn != null && caster != null && pawn != null)
            {
                bool flag;
                if (caster == null)
                {
                    flag = (null != null);
                }
                else
                {
                    Pawn_JobTracker jobs = caster.jobs;
                    flag = ((jobs?.curJob) != null);
                }
                if (flag && CamoAIUtility.JobIsCastException(caster.jobs.curJob.def))
                {
                    return(true);
                }
                if (CamoUtility.IsTargetHidden(pawn, caster))
                {
                    __result = false;
                    return(false);
                }
            }
            return(true);
        }