From 6cc6337781fa82c92e1b37a3aca37c2aef6078d0 Mon Sep 17 00:00:00 2001 From: Frederik Ramm Date: Thu, 26 Sep 2024 12:02:44 +0200 Subject: [PATCH] do not overwrite vehicle maxspeed with higher value, fixes #6979 --- profiles/lib/way_handlers.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/profiles/lib/way_handlers.lua b/profiles/lib/way_handlers.lua index b13410235..87b4b6e2c 100644 --- a/profiles/lib/way_handlers.lua +++ b/profiles/lib/way_handlers.lua @@ -438,11 +438,11 @@ function WayHandlers.maxspeed(profile,way,result,data) backward = WayHandlers.parse_maxspeed(backward,profile) if forward and forward > 0 then - result.forward_speed = forward * profile.speed_reduction + result.forward_speed = math.min(forward * profile.speed_reduction, result.forward_speed) end if backward and backward > 0 then - result.backward_speed = backward * profile.speed_reduction + result.backward_speed = math.min(backward * profile.speed_reduction, result.backward_speed) end end