Skip to content

Commit

Permalink
apply changes for RealTimeOffline
Browse files Browse the repository at this point in the history
  • Loading branch information
erazortt committed Dec 18, 2023
1 parent 767261e commit c0d2ae4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/RealTime/Core/RealTimeCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ namespace RealTime.Core
using SkyTools.Localization;
using SkyTools.Storage;
using SkyTools.Tools;
using System.Linq;
using ColossalFramework.Plugins;

/// <summary>
/// The core component of the Real Time mod. Activates and deactivates
Expand Down Expand Up @@ -275,7 +277,8 @@ public void Translate(ILocalizationProvider localizationProvider)

private static void CheckMethodPatches(Compatibility compatibility)
{
if (compatibility.IsAnyModActive(WorkshopMods.CitizenLifecycleRebalance, WorkshopMods.LifecycleRebalanceRevisited))
var piLR = PluginManager.instance.GetPluginsInfo().FirstOrDefault(pi => pi.name.Contains("LifecycleRebalance"));
if (piLR != null || compatibility.IsAnyModActive(WorkshopMods.CitizenLifecycleRebalance, WorkshopMods.LifecycleRebalanceRevisited))
{
ApplyCitizenPatch = false;
Log.Info("The 'Real Time' mod will not change the citizens aging because a 'Lifecycle Rebalance' mod is active.");
Expand Down Expand Up @@ -315,7 +318,8 @@ private static bool SetupCustomAI(
return false;
}

float travelDistancePerCycle = compatibility.IsAnyModActive(WorkshopMods.RealisticWalkingSpeed)
var piRWS = PluginManager.instance.GetPluginsInfo().FirstOrDefault(pi => pi.name.Contains("RealisticWalkingSpeed"));
float travelDistancePerCycle = (piRWS != null || compatibility.IsAnyModActive(WorkshopMods.RealisticWalkingSpeed))
? Constants.AverageTravelDistancePerCycle * 0.583f
: Constants.AverageTravelDistancePerCycle;

Expand Down
2 changes: 1 addition & 1 deletion src/RealTime/Core/RealTimeMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private static string GetModPath()
}

var pluginInfo = PluginManager.instance.GetPluginsInfo()
.FirstOrDefault(pi => pi.publishedFileID.AsUInt64 == WorkshopId);
.FirstOrDefault(pi => pi.name.Contains("RealTime"));

return pluginInfo?.modPath;
}
Expand Down

0 comments on commit c0d2ae4

Please sign in to comment.