diff --git a/src/RealTime/CustomAI/RealTimeResidentAI.Common.cs b/src/RealTime/CustomAI/RealTimeResidentAI.Common.cs index 5821a8fd..29ad6f58 100644 --- a/src/RealTime/CustomAI/RealTimeResidentAI.Common.cs +++ b/src/RealTime/CustomAI/RealTimeResidentAI.Common.cs @@ -353,7 +353,7 @@ private bool UpdateCitizenSchedule(ref CitizenSchedule schedule, uint citizenId, private void ExecuteCitizenSchedule(ref CitizenSchedule schedule, TAI instance, uint citizenId, ref TCitizen citizen, bool noReschedule) { - if (ProcessCurrentState(ref schedule, citizenId, ref citizen) + if (ProcessCurrentState(ref schedule, instance, citizenId, ref citizen) && schedule.ScheduledState == ResidentState.Unknown && !noReschedule) { @@ -415,7 +415,7 @@ private void ExecuteCitizenSchedule(ref CitizenSchedule schedule, TAI instance, } } - private bool ProcessCurrentState(ref CitizenSchedule schedule, uint citizenId, ref TCitizen citizen) + private bool ProcessCurrentState(ref CitizenSchedule schedule, TAI instance, uint citizenId, ref TCitizen citizen) { switch (schedule.CurrentState) { @@ -429,7 +429,7 @@ private bool ProcessCurrentState(ref CitizenSchedule schedule, uint citizenId, r return ProcessCitizenRelaxing(ref schedule, citizenId, ref citizen); case ResidentState.Visiting: - return ProcessCitizenVisit(ref schedule, citizenId, ref citizen); + return ProcessCitizenVisit(ref schedule, instance, citizenId, ref citizen); case ResidentState.InShelter: return ProcessCitizenInShelter(ref schedule, ref citizen); diff --git a/src/RealTime/CustomAI/RealTimeResidentAI.Visit.cs b/src/RealTime/CustomAI/RealTimeResidentAI.Visit.cs index 5014cdb8..12d56f82 100644 --- a/src/RealTime/CustomAI/RealTimeResidentAI.Visit.cs +++ b/src/RealTime/CustomAI/RealTimeResidentAI.Visit.cs @@ -244,13 +244,13 @@ private bool ProcessCitizenShopping(ref CitizenSchedule schedule, uint citizenId return RescheduleVisit(ref schedule, citizenId, ref citizen, currentBuilding); } - private bool ProcessCitizenVisit(ref CitizenSchedule schedule, uint citizenId, ref TCitizen citizen) + private bool ProcessCitizenVisit(ref CitizenSchedule schedule, TAI instance, uint citizenId, ref TCitizen citizen) { var currentBuilding = CitizenProxy.GetVisitBuilding(ref citizen); var currentBuildingService = BuildingMgr.GetBuildingService(currentBuilding); if (currentBuildingService == ItemClass.Service.Education) { - residentAI.AttemptAutodidact(ref citizen, currentBuildingService); + residentAI.AttemptAutodidact(instance, ref citizen, currentBuildingService); } return RescheduleVisit(ref schedule, citizenId, ref citizen, currentBuilding); diff --git a/src/RealTime/GameConnection/ResidentAIConnection.cs b/src/RealTime/GameConnection/ResidentAIConnection.cs index 2c19cfe9..15945e3c 100644 --- a/src/RealTime/GameConnection/ResidentAIConnection.cs +++ b/src/RealTime/GameConnection/ResidentAIConnection.cs @@ -102,9 +102,10 @@ public ResidentAIConnection( /// Represents the method that corresponds to the AI's original AttemptAutodidact method /// that updates the citizen's education level after visiting a library. /// + /// The AI instance the method is called on. /// The citizen object to process. /// The type of the building the citizen leaves. - public delegate void AttemptAutodidactDelegate(ref TCitizen citizen, ItemClass.Service visitedBuildingType); + public delegate void AttemptAutodidactDelegate(TAI instance, ref TCitizen citizen, ItemClass.Service visitedBuildingType); /// Gets a method that calls a . public FindHospitalDelegate FindHospital { get; }