Skip to content

Commit

Permalink
Refinements to Clock time hack
Browse files Browse the repository at this point in the history
Now only fires when maxRange > 0 and flag & 1. This eliminates other uses where range is unused and flag & 1.
Will perform another travel time check if location available and total time 0, then add extra range. This should support automatic NPCs for now.
  • Loading branch information
Interkarma committed May 8, 2018
1 parent 5aaae1e commit 3b3e894
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Assets/Scripts/Game/Questing/Clock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,18 @@ public override void SetResource(string line)
clockTimeInSeconds = GetTravelTimeInSeconds();
}

// HACK: Also check for travel time when flag & 1 and clock time otherwise 0
// This seems to indicate an automatic Place from derived from Person?
// Keep seperate to above until more research is done
if ((flag & 1) == 1 && clockTimeInSeconds == 0)
// HACK: Add range of time in days when flag & 1 and maxRange > 0
// Still not positive this is the correct usage of minRange - maxRange
if ((flag & 1) == 1 && maxRange > 0)
{
clockTimeInSeconds = GetTravelTimeInSeconds();
// Perform another check for travel time if total time 0
// This ensures player has travel time from automatic NPCs
if (clockTimeInSeconds == 0)
GetTravelTimeInSeconds();

// Add range
int randomDays = UnityEngine.Random.Range(minRange, maxRange + 1);
clockTimeInSeconds += randomDays * DaggerfallDateTime.SecondsPerDay;
}

// Set timer value in seconds
Expand Down

0 comments on commit 3b3e894

Please sign in to comment.