Skip to content

Commit

Permalink
Hotfix: Train/Tram despawning problem fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorPhilipp committed Jul 24, 2016
1 parent 6b061da commit 6cc3ffe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion TLM/TLM/Custom/AI/CustomTrainAI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void TrafficManagerSimulationStep(ushort vehicleId, ref Vehicle vehicleDa
}
}
}
if ((vehicleData.m_flags & (Vehicle.Flags.Spawned | Vehicle.Flags.WaitingPath | Vehicle.Flags.WaitingSpace | Vehicle.Flags.WaitingCargo)) == 0 && Options.enableDespawning) {
if ((vehicleData.m_flags & (Vehicle.Flags.Spawned | Vehicle.Flags.WaitingPath | Vehicle.Flags.WaitingSpace | Vehicle.Flags.WaitingCargo)) == 0 || (vehicleData.m_blockCounter == 255 && Options.enableDespawning)) {
Singleton<VehicleManager>.instance.ReleaseVehicle(vehicleId);
}
}
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Custom/AI/CustomTramBaseAI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void CustomSimulationStep(ushort vehicleId, ref Vehicle vehicleData, Vect
break;
}
}
if ((vehicleData.m_flags & (Vehicle.Flags.Spawned | Vehicle.Flags.WaitingPath | Vehicle.Flags.WaitingSpace | Vehicle.Flags.WaitingCargo)) == 0 && Options.enableDespawning) {
if ((vehicleData.m_flags & (Vehicle.Flags.Spawned | Vehicle.Flags.WaitingPath | Vehicle.Flags.WaitingSpace | Vehicle.Flags.WaitingCargo)) == 0 || (vehicleData.m_blockCounter == 255 && Options.enableDespawning)) {
Singleton<VehicleManager>.instance.ReleaseVehicle(vehicleId);
}
}
Expand Down
2 changes: 2 additions & 0 deletions TLM/TLM/UI/UITrafficManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ public static void deactivateButtons() {
_buttonTimedMain.focusedBgSprite = "ButtonMenu";
if (_buttonLaneChange != null)
_buttonLaneChange.focusedBgSprite = "ButtonMenu";
if (_buttonLaneConnector != null)
_buttonLaneConnector.focusedBgSprite = "ButtonMenu";
//_buttonLaneRestrictions.focusedBgSprite = "ButtonMenu";
if (_buttonClearTraffic != null)
_buttonClearTraffic.focusedBgSprite = "ButtonMenu";
Expand Down

0 comments on commit 6cc3ffe

Please sign in to comment.