public override ThinkNode DeepCopy(bool resolve = true)
        {
            ThinkNode_ForbidOutsideFlagRadius thinkNode_ForbidOutsideFlagRadius = (ThinkNode_ForbidOutsideFlagRadius)base.DeepCopy(resolve);

            thinkNode_ForbidOutsideFlagRadius.maxDistToSquadFlag = maxDistToSquadFlag;
            return(thinkNode_ForbidOutsideFlagRadius);
        }
Example #2
0
        public static bool TryIssueJobPackage(ThinkNode_ForbidOutsideFlagRadius __instance, ref ThinkResult __result, Pawn pawn, JobIssueParams jobParams)
        {
            __result = ThinkResult.NoJob;
            if (pawn == null)
            {
                return(false);
            }
            Pawn_MindState mindState = pawn.mindState;

            if (mindState == null)
            {
                return(false);
            }
            try
            {
                if (__instance.maxDistToSquadFlag > 0.0)
                {
                    if (mindState.maxDistToSquadFlag > 0.0)
                    {
                        Log.Error("Squad flag was not reset properly; raiders may behave strangely");
                    }
                    pawn.mindState.maxDistToSquadFlag = __instance.maxDistToSquadFlag;
                }
                __result = TryIssueJobPackage2(__instance, pawn, jobParams);
                return(false);
            }
            finally
            {
                pawn.mindState.maxDistToSquadFlag = -1f;
            }
        }