one more of the ill fated traincontroller shared usages while on host processing.

This commit is contained in:
2025-09-01 23:53:23 -05:00
parent b911ee6f6f
commit f1b68d2827

View File

@@ -34,8 +34,7 @@ internal class AutoEngineerPlanner_HandleCommand_Patch
{
TweaksAndThingsPlugin tweaksAndThings = SingletonPluginBase<TweaksAndThingsPlugin>.Shared;
if (!tweaksAndThings.IsEnabled() || !tweaksAndThings.SafetyFirst() || (sender.IsRemote && !tweaksAndThings.SafetyFirstClientEnforce()) || command.MaxSpeedMph <= governedSpeed) return true;
BaseLocomotive loco = TrainController.Shared.SelectedLocomotive;
if (TrainController.Shared.TryGetCarForId(command.LocomotiveId, out Car c)) loco = (BaseLocomotive)c;
BaseLocomotive loco = __instance._locomotive;
if (SafetyFirstGoverningApplies(loco))
{