diff --git a/src/RealTime/CustomAI/RealTimeResidentAI.Home.cs b/src/RealTime/CustomAI/RealTimeResidentAI.Home.cs index cb23739d..d3d86de3 100644 --- a/src/RealTime/CustomAI/RealTimeResidentAI.Home.cs +++ b/src/RealTime/CustomAI/RealTimeResidentAI.Home.cs @@ -20,11 +20,17 @@ private void DoScheduledHome(ref CitizenSchedule schedule, TAI instance, uint ci ushort currentBuilding = CitizenProxy.GetCurrentBuilding(ref citizen); CitizenProxy.RemoveFlags(ref citizen, Citizen.Flags.Evacuating); +#if DEBUG + string logEntry = $"{GetCitizenDesc(citizenId, ref citizen)} is going from {currentBuilding} back home"; +#else + const string logEntry = null; +#endif + if (residentAI.StartMoving(instance, citizenId, ref citizen, currentBuilding, homeBuilding)) { CitizenProxy.SetVisitPlace(ref citizen, citizenId, 0); schedule.Schedule(ResidentState.Unknown); - Log.Debug(LogCategory.Movement, TimeInfo.Now, $"{GetCitizenDesc(citizenId, ref citizen)} is going from {currentBuilding} back home"); + Log.Debug(LogCategory.Movement, TimeInfo.Now, logEntry); } else { diff --git a/src/RealTime/CustomAI/RealTimeResidentAI.SchoolWork.cs b/src/RealTime/CustomAI/RealTimeResidentAI.SchoolWork.cs index 82f16ea7..c4ae38b2 100644 --- a/src/RealTime/CustomAI/RealTimeResidentAI.SchoolWork.cs +++ b/src/RealTime/CustomAI/RealTimeResidentAI.SchoolWork.cs @@ -66,6 +66,12 @@ private void DoScheduledWork(ref CitizenSchedule schedule, TAI instance, uint ci return; } +#if DEBUG + string citizenDesc = GetCitizenDesc(citizenId, ref citizen); +#else + const string citizenDesc = null; +#endif + if (residentAI.StartMoving(instance, citizenId, ref citizen, currentBuilding, schedule.WorkBuilding)) { if (schedule.CurrentState != ResidentState.AtHome) @@ -78,12 +84,12 @@ private void DoScheduledWork(ref CitizenSchedule schedule, TAI instance, uint ci Citizen.AgeGroup citizenAge = CitizenProxy.GetAge(ref citizen); if (workBehavior.ScheduleLunch(ref schedule, citizenAge)) { - Log.Debug(LogCategory.Movement, TimeInfo.Now, $"{GetCitizenDesc(citizenId, ref citizen)} is going from {currentBuilding} to school/work {schedule.WorkBuilding} and will go to lunch at {schedule.ScheduledStateTime}"); + Log.Debug(LogCategory.Movement, TimeInfo.Now, $"{citizenDesc} is going from {currentBuilding} to school/work {schedule.WorkBuilding} and will go to lunch at {schedule.ScheduledStateTime}"); } else { workBehavior.ScheduleReturnFromWork(ref schedule, citizenAge); - Log.Debug(LogCategory.Movement, TimeInfo.Now, $"{GetCitizenDesc(citizenId, ref citizen)} is going from {currentBuilding} to school/work {schedule.WorkBuilding} and will leave work at {schedule.ScheduledStateTime}"); + Log.Debug(LogCategory.Movement, TimeInfo.Now, $"{citizenDesc} is going from {currentBuilding} to school/work {schedule.WorkBuilding} and will leave work at {schedule.ScheduledStateTime}"); } } else