summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy <1780327+andythenorth@users.noreply.github.com>2021-01-03 21:19:06 +0000
committerGitHub <noreply@github.com>2021-01-03 22:19:06 +0100
commit0f91cb04791b329c5e457588a39d1e7a43e43136 (patch)
tree7bd403d55c584d09eb57661b3ee51d45dc20f080
parent4ce53cb85113956be318c12801d5663a26e3fef9 (diff)
downloadopenttd-0f91cb04791b329c5e457588a39d1e7a43e43136.tar.xz
Fix: GetCurveSpeedLimit needs railtype from current tile (#8466)
-rw-r--r--src/train_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 5d02764b5..71fec8cfb 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -349,8 +349,8 @@ int Train::GetCurveSpeedLimit() const
}
if (max_speed != absolute_max_speed) {
- /* Apply the engine's rail type curve speed advantage, if it slowed by curves */
- const RailtypeInfo *rti = GetRailTypeInfo(this->railtype);
+ /* Apply the current railtype's curve speed advantage */
+ const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(this->tile));
max_speed += (max_speed / 2) * rti->curve_speed;
if (this->tcache.cached_tilt) {