Erabior / RouteManager

Mod for Railroader the game that adds basic automation for passenger routes
12 stars 5 forks source link

V2 - wasCurrentStopServed - Fails to handle edge case: Train Full #64

Closed armyf35 closed 7 months ago

armyf35 commented 7 months ago

From Dev Train will not exit a station if all passenger cars are full, and there are valid (Going to a station the train will serve) passengers to take

It loops on has not finished loading and unloading at _ Station. It seems like https://github.com/Erabior/RouteManager/blob/138185b6c9adfbb749ec775ca9e6488c456830fb/v2/core/AutoEngineer.cs#L565 will never trigger, carsLoaded will eventually be false but passWaiting will always be true

AdamC1228 commented 7 months ago

Makes sense upon review. During testing and design that is an edge case that I missed. Simple enough fix. I will address this when I work on alpha 2 this weekend.

armyf35 commented 7 months ago

Just throwing suggestions out there. I think this would work if (!carsLoaded && (carsAtCapacity || !passWaiting)), not sure how to check car capacity vs filled amount.

AdamC1228 commented 7 months ago

That would probably suffice however I would rather break the check out into another if case for 2 reasons.

AdamC1228 commented 7 months ago

Potential fix implemented and now available on the v2-dev branch. Feel free to retest / verify but you will need to manually compile the code.

armyf35 commented 7 months ago

Looks like that fixed it.