diff --git a/src/RealTime/CustomAI/RealTimeResidentAI.Common.cs b/src/RealTime/CustomAI/RealTimeResidentAI.Common.cs index 5821a8fd673cf1fc5d0e244278652fb3a7435f72..29ad6f58975f598d2bcd2fab7e66dbff98f49dcb 100644 --- a/src/RealTime/CustomAI/RealTimeResidentAI.Common.cs +++ b/src/RealTime/CustomAI/RealTimeResidentAI.Common.cs @@ -353,7 +353,7 @@ namespace RealTime.CustomAI 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 @@ namespace RealTime.CustomAI } } - 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 @@ namespace RealTime.CustomAI 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 5014cdb8979e725e44e39954d6c1abb421677756..12d56f82c1a7e8e17b2bf471dcae4caa5957738d 100644 --- a/src/RealTime/CustomAI/RealTimeResidentAI.Visit.cs +++ b/src/RealTime/CustomAI/RealTimeResidentAI.Visit.cs @@ -244,13 +244,13 @@ namespace RealTime.CustomAI 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 2c19cfe9006f86e7ed7ebb043e35e3379ee44257..15945e3c5154b69596b283a8651b635b65e8ab28 100644 --- a/src/RealTime/GameConnection/ResidentAIConnection.cs +++ b/src/RealTime/GameConnection/ResidentAIConnection.cs @@ -102,9 +102,10 @@ namespace RealTime.GameConnection /// 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; }