summaryrefslogtreecommitdiff
path: root/src/timetable_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-04-18 14:56:05 +0000
committerfrosch <frosch@openttd.org>2010-04-18 14:56:05 +0000
commit2e90f7f8b975d380c3d544995ef6db9d6c8a86d8 (patch)
tree90fb0852bd31229b016ca998a8e6c0ce44d699dd /src/timetable_cmd.cpp
parent2330851d1dc0650335bc73ec4cfd010f08c55742 (diff)
downloadopenttd-2e90f7f8b975d380c3d544995ef6db9d6c8a86d8.tar.xz
(svn r19670) -Codechange: Add CeilDiv() and RoundDiv() to simplify integer divisions with rounding.
Diffstat (limited to 'src/timetable_cmd.cpp')
-rw-r--r--src/timetable_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp
index c003acbee..9cc8ddb0c 100644
--- a/src/timetable_cmd.cpp
+++ b/src/timetable_cmd.cpp
@@ -279,7 +279,7 @@ void UpdateVehicleTimetable(Vehicle *v, bool travelling)
/* Round the time taken up to the nearest day, as this will avoid
* confusion for people who are timetabling in days, and can be
* adjusted later by people who aren't. */
- time_taken = (((time_taken - 1) / DAY_TICKS) + 1) * DAY_TICKS;
+ time_taken = CeilDiv(time_taken, DAY_TICKS) * DAY_TICKS;
ChangeTimetable(v, v->cur_order_index, time_taken, travelling);
}