public void ExposeData() { if (Scribe.mode == LoadSaveMode.Saving) { lastJobGiverKey = ((lastJobGiver == null) ? (-1) : lastJobGiver.UniqueSaveKey); } Scribe_Values.Look(ref lastJobGiverKey, "lastJobGiverKey", -1); if (Scribe.mode == LoadSaveMode.PostLoadInit && lastJobGiverKey != -1 && !lastJobGiverThinkTree.TryGetThinkNodeWithSaveKey(lastJobGiverKey, out lastJobGiver)) { Log.Warning("Could not find think node with key " + lastJobGiverKey); } Scribe_References.Look(ref meleeThreat, "meleeThreat"); Scribe_References.Look(ref enemyTarget, "enemyTarget"); Scribe_References.Look(ref knownExploder, "knownExploder"); Scribe_References.Look(ref lastMannedThing, "lastMannedThing"); Scribe_Defs.Look(ref lastJobGiverThinkTree, "lastJobGiverThinkTree"); Scribe_TargetInfo.Look(ref lastAttackedTarget, "lastAttackedTarget"); Scribe_Collections.Look(ref thinkData, "thinkData", LookMode.Value, LookMode.Value); Scribe_Values.Look(ref activeInt, "active", defaultValue: true); Scribe_Values.Look(ref lastJobTag, "lastJobTag", JobTag.Misc); Scribe_Values.Look(ref lastIngestTick, "lastIngestTick", -99999); Scribe_Values.Look(ref nextApparelOptimizeTick, "nextApparelOptimizeTick", -99999); Scribe_Values.Look(ref lastEngageTargetTick, "lastEngageTargetTick", 0); Scribe_Values.Look(ref lastAttackTargetTick, "lastAttackTargetTick", 0); Scribe_Values.Look(ref canFleeIndividual, "canFleeIndividual", defaultValue: false); Scribe_Values.Look(ref exitMapAfterTick, "exitMapAfterTick", -99999); Scribe_Values.Look(ref forcedGotoPosition, "forcedGotoPosition", IntVec3.Invalid); Scribe_Values.Look(ref lastMeleeThreatHarmTick, "lastMeleeThreatHarmTick", 0); Scribe_Values.Look(ref lastAssignedInteractTime, "lastAssignedInteractTime", -99999); Scribe_Values.Look(ref interactionsToday, "interactionsToday", 0); Scribe_Values.Look(ref lastInventoryRawFoodUseTick, "lastInventoryRawFoodUseTick", 0); Scribe_Values.Look(ref lastDisturbanceTick, "lastDisturbanceTick", -99999); Scribe_Values.Look(ref wantsToTradeWithColony, "wantsToTradeWithColony", defaultValue: false); Scribe_Values.Look(ref canLovinTick, "canLovinTick", -99999); Scribe_Values.Look(ref canSleepTick, "canSleepTick", -99999); Scribe_Values.Look(ref nextMoveOrderIsWait, "nextMoveOrderIsWait", defaultValue: true); Scribe_Values.Look(ref lastTakeCombatEnhancingDrugTick, "lastTakeCombatEnhancingDrugTick", -99999); Scribe_Values.Look(ref lastHarmTick, "lastHarmTick", -99999); Scribe_Values.Look(ref anyCloseHostilesRecently, "anyCloseHostilesRecently", defaultValue: false); Scribe_Deep.Look(ref duty, "duty"); Scribe_Deep.Look(ref mentalStateHandler, "mentalStateHandler", pawn); Scribe_Deep.Look(ref mentalBreaker, "mentalBreaker", pawn); Scribe_Deep.Look(ref inspirationHandler, "inspirationHandler", pawn); Scribe_Deep.Look(ref priorityWork, "priorityWork", pawn); Scribe_Values.Look(ref applyBedThoughtsTick, "applyBedThoughtsTick", 0); Scribe_Values.Look(ref applyBedThoughtsOnLeave, "applyBedThoughtsOnLeave", defaultValue: false); Scribe_Values.Look(ref willJoinColonyIfRescuedInt, "willJoinColonyIfRescued", defaultValue: false); Scribe_Values.Look(ref wildManEverReachedOutsideInt, "wildManEverReachedOutside", defaultValue: false); Scribe_Values.Look(ref timesGuestTendedToByPlayer, "timesGuestTendedToByPlayer", 0); Scribe_Values.Look(ref lastSelfTendTick, "lastSelfTendTick", 0); Scribe_Values.Look(ref spawnedByInfestationThingComp, "spawnedByInfestationThingComp", defaultValue: false); Scribe_Values.Look(ref lastPredatorHuntingPlayerNotificationTick, "lastPredatorHuntingPlayerNotificationTick", -99999); if (Scribe.mode == LoadSaveMode.PostLoadInit) { BackCompatibility.MindStatePostLoadInit(this); } }
public void ExposeData() { ILoadReferenceable refee = (ILoadReferenceable)commTarget; Scribe_References.Look(ref refee, "commTarget"); commTarget = (ICommunicable)refee; Scribe_References.Look(ref verbToUse, "verbToUse"); Scribe_References.Look(ref bill, "bill"); Scribe_References.Look(ref lord, "lord"); Scribe_References.Look(ref quest, "quest"); Scribe_Defs.Look(ref def, "def"); Scribe_Values.Look(ref loadID, "loadID", 0); Scribe_TargetInfo.Look(ref targetA, "targetA"); Scribe_TargetInfo.Look(ref targetB, "targetB"); Scribe_TargetInfo.Look(ref targetC, "targetC"); Scribe_Collections.Look(ref targetQueueA, "targetQueueA", LookMode.Undefined); Scribe_Collections.Look(ref targetQueueB, "targetQueueB", LookMode.Undefined); Scribe_Values.Look(ref count, "count", -1); Scribe_Collections.Look(ref countQueue, "countQueue", LookMode.Undefined); Scribe_Values.Look(ref startTick, "startTick", -1); Scribe_Values.Look(ref expiryInterval, "expiryInterval", -1); Scribe_Values.Look(ref checkOverrideOnExpire, "checkOverrideOnExpire", defaultValue: false); Scribe_Values.Look(ref playerForced, "playerForced", defaultValue: false); Scribe_Collections.Look(ref placedThings, "placedThings", LookMode.Undefined); Scribe_Values.Look(ref maxNumMeleeAttacks, "maxNumMeleeAttacks", int.MaxValue); Scribe_Values.Look(ref maxNumStaticAttacks, "maxNumStaticAttacks", int.MaxValue); Scribe_Values.Look(ref exitMapOnArrival, "exitMapOnArrival", defaultValue: false); Scribe_Values.Look(ref failIfCantJoinOrCreateCaravan, "failIfCantJoinOrCreateCaravan", defaultValue: false); Scribe_Values.Look(ref killIncappedTarget, "killIncappedTarget", defaultValue: false); Scribe_Values.Look(ref haulOpportunisticDuplicates, "haulOpportunisticDuplicates", defaultValue: false); Scribe_Values.Look(ref haulMode, "haulMode", HaulMode.Undefined); Scribe_Defs.Look(ref plantDefToSow, "plantDefToSow"); Scribe_Values.Look(ref locomotionUrgency, "locomotionUrgency", LocomotionUrgency.Jog); Scribe_Values.Look(ref ignoreDesignations, "ignoreDesignations", defaultValue: false); Scribe_Values.Look(ref canBash, "canBash", defaultValue: false); Scribe_Values.Look(ref canUseRangedWeapon, "canUseRangedWeapon", defaultValue: true); Scribe_Values.Look(ref haulDroppedApparel, "haulDroppedApparel", defaultValue: false); Scribe_Values.Look(ref restUntilHealed, "restUntilHealed", defaultValue: false); Scribe_Values.Look(ref ignoreJoyTimeAssignment, "ignoreJoyTimeAssignment", defaultValue: false); Scribe_Values.Look(ref overeat, "overeat", defaultValue: false); Scribe_Values.Look(ref attackDoorIfTargetLost, "attackDoorIfTargetLost", defaultValue: false); Scribe_Values.Look(ref takeExtraIngestibles, "takeExtraIngestibles", 0); Scribe_Values.Look(ref expireRequiresEnemiesNearby, "expireRequiresEnemiesNearby", defaultValue: false); Scribe_Values.Look(ref collideWithPawns, "collideWithPawns", defaultValue: false); Scribe_Values.Look(ref forceSleep, "forceSleep", defaultValue: false); Scribe_Defs.Look(ref interaction, "interaction"); Scribe_Values.Look(ref endIfCantShootTargetFromCurPos, "endIfCantShootTargetFromCurPos", defaultValue: false); Scribe_Values.Look(ref endIfCantShootInMelee, "endIfCantShootInMelee", defaultValue: false); Scribe_Values.Look(ref checkEncumbrance, "checkEncumbrance", defaultValue: false); Scribe_Values.Look(ref followRadius, "followRadius", 0f); Scribe_Values.Look(ref endAfterTendedOnce, "endAfterTendedOnce", defaultValue: false); Scribe_Defs.Look(ref workGiverDef, "workGiverDef"); Scribe_Defs.Look(ref jobGiverThinkTree, "jobGiverThinkTree"); Scribe_Values.Look(ref doUntilGatheringEnded, "doUntilGatheringEnded", defaultValue: false); if (Scribe.mode == LoadSaveMode.Saving) { jobGiverKey = ((jobGiver != null) ? jobGiver.UniqueSaveKey : (-1)); } Scribe_Values.Look(ref jobGiverKey, "lastJobGiverKey", -1); if (Scribe.mode == LoadSaveMode.PostLoadInit && jobGiverKey != -1 && !jobGiverThinkTree.TryGetThinkNodeWithSaveKey(jobGiverKey, out jobGiver)) { Log.Warning("Could not find think node with key " + jobGiverKey); } if (Scribe.mode == LoadSaveMode.PostLoadInit && verbToUse != null && verbToUse.BuggedAfterLoading) { verbToUse = null; Log.Warning(GetType() + " had a bugged verbToUse after loading."); } }