time should be calculated in the correct handler
This commit is contained in:
@@ -28,10 +28,14 @@ namespace Nox.Game {
|
||||
(0.90f, DayPhase.Night)
|
||||
};
|
||||
|
||||
public TimeHandler(AdventureSettings adventureSettings, AdventureData adventureData, WorldClock worldClock) {
|
||||
public TimeHandler(AdventureSettings adventureSettings, AdventureData adventureData, WorldClock worldClock, CalendarSettings calendarSettings) {
|
||||
this.adventureSettings = adventureSettings;
|
||||
this.adventureData = adventureData;
|
||||
this.worldClock = worldClock;
|
||||
// restore time from saved data
|
||||
var totalMinutes = (adventureData.currentDay * calendarSettings.MinutesPerDay)
|
||||
+ (int)(adventureData.currentTime * calendarSettings.MinutesPerDay);
|
||||
worldClock.AdvanceMinutes(totalMinutes);
|
||||
localTime = adventureData.currentTime * adventureSettings.dayLength;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user