New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix GetVanillaNetInfoSpeedLimit()
to only inspect customisable lanes
#1362
Conversation
…laLaneSpeedLimit` Make it obvious it's not merely getting a value, it's doing some iteration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright
@kvakvs In the |
GetVanillaNetInfoSpeedLimit()
to only inspect customisable lanes
It's only for configurable networks. There is no need to test other lanes than supported since unsupported things are handled by vanilla code, not TM:PE. |
- [Meta] TM:PE 11.6.4-hotfix-7 - [Meta] Bugfix for default speeds which affects speed limits tool, overlays, and roundabout curvature speed - [Fixed] Default netinfo speed should only inspect customisable lanes #1362 #1346 (aubergine18) - [Fixed] Fix `SPEED_TO_MPH` value in `ApiConstants.cs` #1364 #1363 #988 (aubergine18) - [Removed] Obsolete: `SPEED_TO_MPH` and `SPEED_TO_KMPH` in `Constants.cs` #1364 #1363 (aubergine18)
I'm going to do some additional testing in-game just in case :) |
Fixes: #1346
GetVanillaNetInfoSpeedLimit()
was not filtering lanes to those which may have custom speed limits, resulting in problems like this (trace logging from #1346):In the example above, we should have been getting a return value of
0.6
but were instead getting1
.This should fix some weird bugs at the following call sites:
LoadData()
ofSpeedLimitsManager
)My biggest worry with this PR is how it will affect networks which aren't applicable for custom speed limits (eg. ship paths, pedestrian paths, etc) - I suspect we will need to create an additional method (which merely skips
None, None
type lanes, rather than looking for customisable lanes) for use in theLoadData()
ofSpeedLimitsManager
but will wait for feedback from devs who have worked on this code before doing that.