diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-01-12 15:53:59 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-01-12 15:53:59 -0500 |
commit | 8b1fd90c6e72bff99d81a3b9614fdeaa6f67a950 (patch) | |
tree | cb62acfdcabd66117d559c5341c1b23dfd94151a /src/SMAPI/Metadata/CoreAssetPropagator.cs | |
parent | 5518e4cf241e487da26bd2e651a57724389edfe2 (diff) | |
download | SMAPI-8b1fd90c6e72bff99d81a3b9614fdeaa6f67a950.tar.gz SMAPI-8b1fd90c6e72bff99d81a3b9614fdeaa6f67a950.tar.bz2 SMAPI-8b1fd90c6e72bff99d81a3b9614fdeaa6f67a950.zip |
remove invalid-schedule error which can have false positives (e.g. when NPC is married to a player)
Diffstat (limited to 'src/SMAPI/Metadata/CoreAssetPropagator.cs')
-rw-r--r-- | src/SMAPI/Metadata/CoreAssetPropagator.cs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index abe28ce9..57e1d197 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -909,18 +909,16 @@ namespace StardewModdingAPI.Metadata this.Reflection.GetField<bool>(villager, "_hasLoadedMasterScheduleData").SetValue(false); this.Reflection.GetField<Dictionary<string, string>>(villager, "_masterScheduleData").SetValue(null); villager.Schedule = villager.getSchedule(Game1.dayOfMonth); - if (villager.Schedule == null) - { - this.Monitor.Log($"A mod set an invalid schedule for {villager.Name ?? key}, so the NPC may not behave correctly.", LogLevel.Warn); - return true; - } // switch to new schedule if needed - int lastScheduleTime = villager.Schedule.Keys.Where(p => p <= Game1.timeOfDay).OrderByDescending(p => p).FirstOrDefault(); - if (lastScheduleTime != 0) + if (villager.Schedule != null) { - villager.scheduleTimeToTry = NPC.NO_TRY; // use time that's passed in to checkSchedule - villager.checkSchedule(lastScheduleTime); + int lastScheduleTime = villager.Schedule.Keys.Where(p => p <= Game1.timeOfDay).OrderByDescending(p => p).FirstOrDefault(); + if (lastScheduleTime != 0) + { + villager.scheduleTimeToTry = NPC.NO_TRY; // use time that's passed in to checkSchedule + villager.checkSchedule(lastScheduleTime); + } } } return true; |