summaryrefslogtreecommitdiff
path: root/src/cheat_gui.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/cheat_gui.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/cheat_gui.cpp')
-rw-r--r--src/cheat_gui.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp
index 47c34566f..c49eb429e 100644
--- a/src/cheat_gui.cpp
+++ b/src/cheat_gui.cpp
@@ -24,6 +24,7 @@
#include "rail_gui.h"
#include "settings_gui.h"
#include "company_gui.h"
+#include "linkgraph/linkgraph.h"
#include "widgets/cheat_widget.h"
@@ -100,7 +101,10 @@ static int32 ClickChangeDateCheat(int32 p1, int32 p2)
p1 = Clamp(p1, MIN_YEAR, MAX_YEAR);
if (p1 == _cur_year) return _cur_year;
- SetDate(ConvertYMDToDate(p1, ymd.month, ymd.day), _date_fract);
+ Date new_date = ConvertYMDToDate(p1, ymd.month, ymd.day);
+ LinkGraph *lg;
+ FOR_ALL_LINK_GRAPHS(lg) lg->ShiftDates(new_date - _date);
+ SetDate(new_date, _date_fract);
EnginesMonthlyLoop();
SetWindowDirty(WC_STATUS_BAR, 0);
InvalidateWindowClassesData(WC_BUILD_STATION, 0);