mirror of
https://github.com/rmroc451/TweaksAndThings.git
synced 2025-12-18 10:19:38 -06:00
Merge pull request #22 from rmroc451/1.6.1
Fix issue with cars that are missing tagcallouts from throwing errors.
This commit is contained in:
@@ -70,7 +70,7 @@ internal class CarInspector_PopulateCarPanel_Patch
|
|||||||
private static UIPanelBuilder AddCarConsistRebuildObservers(UIPanelBuilder builder, IEnumerable<Model.Car> consist)
|
private static UIPanelBuilder AddCarConsistRebuildObservers(UIPanelBuilder builder, IEnumerable<Model.Car> consist)
|
||||||
{
|
{
|
||||||
TagController tagController = UnityEngine.Object.FindFirstObjectByType<TagController>();
|
TagController tagController = UnityEngine.Object.FindFirstObjectByType<TagController>();
|
||||||
foreach (Model.Car car in consist)
|
foreach (Model.Car car in consist.Where(c => c.TagCallout != null))
|
||||||
{
|
{
|
||||||
builder = AddObserver(builder, car, PropertyChange.KeyForControl(PropertyChange.Control.Handbrake), tagController);
|
builder = AddObserver(builder, car, PropertyChange.KeyForControl(PropertyChange.Control.Handbrake), tagController);
|
||||||
foreach (LogicalEnd logicalEnd in ends)
|
foreach (LogicalEnd logicalEnd in ends)
|
||||||
|
|||||||
Reference in New Issue
Block a user