summaryrefslogtreecommitdiff
path: root/src/date.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-06-04 15:06:22 +0000
committerrubidium <rubidium@openttd.org>2013-06-04 15:06:22 +0000
commit0fbc7140c5ca955d43db5172235755485a006606 (patch)
tree6b800e37c7cc768304cf4572c5d90c45fece7e08 /src/date.cpp
parent254c3834d0ef508e167f1d3b3c000b1db04b578a (diff)
downloadopenttd-0fbc7140c5ca955d43db5172235755485a006606.tar.xz
(svn r25320) -Fix [FS#5577]: link graph start time was not accounted for when cheating dates
Diffstat (limited to 'src/date.cpp')
-rw-r--r--src/date.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/date.cpp b/src/date.cpp
index 9df648321..5ac94e412 100644
--- a/src/date.cpp
+++ b/src/date.cpp
@@ -18,6 +18,7 @@
#include "date_func.h"
#include "vehicle_base.h"
#include "rail_gui.h"
+#include "linkgraph/linkgraph.h"
#include "saveload/saveload.h"
Year _cur_year; ///< Current year, starting at 0
@@ -211,6 +212,9 @@ static void OnNewYear()
_date -= days_this_year;
FOR_ALL_VEHICLES(v) v->date_of_last_service -= days_this_year;
+ LinkGraph *lg;
+ FOR_ALL_LINK_GRAPHS(lg) lg->ShiftDates(-days_this_year);
+
#ifdef ENABLE_NETWORK
/* Because the _date wraps here, and text-messages expire by game-days, we have to clean out
* all of them if the date is set back, else those messages will hang for ever */