Changeset - r28429:c96850b70da5
[Not reviewed]
master
0 2 0
Loïc Guilloux - 11 months ago 2024-01-10 15:23:36
glx22@users.noreply.github.com
Fix #11748: Incorrect clamping of negative service interval values (#11749)
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/order_cmd.cpp
Show inline comments
 
@@ -1849,7 +1849,7 @@ void DeleteVehicleOrders(Vehicle *v, boo
 
 * @param interval proposed service interval
 
 * @return Clamped service interval
 
 */
 
uint16_t GetServiceIntervalClamped(uint interval, bool ispercent)
 
uint16_t GetServiceIntervalClamped(int interval, bool ispercent)
 
{
 
	return ispercent ? Clamp(interval, MIN_SERVINT_PERCENT, MAX_SERVINT_PERCENT) : Clamp(interval, MIN_SERVINT_DAYS, MAX_SERVINT_DAYS);
 
}
src/order_func.h
Show inline comments
 
@@ -37,6 +37,6 @@ static const uint DEF_SERVINT_PERCENT = 
 
static const uint MIN_SERVINT_PERCENT = 5;
 
static const uint MAX_SERVINT_PERCENT = 90;
 

	
 
uint16_t GetServiceIntervalClamped(uint interval, bool ispercent);
 
uint16_t GetServiceIntervalClamped(int interval, bool ispercent);
 

	
 
#endif /* ORDER_FUNC_H */
0 comments (0 inline, 0 general)