summaryrefslogtreecommitdiff
path: root/src/date.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-08-11 22:45:11 +0000
committerrubidium <rubidium@openttd.org>2008-08-11 22:45:11 +0000
commitd0c1a989a4226cc06a50b1a8c95b9ca8f0b9599e (patch)
tree96b3b7c215db821df9b9268eb9af5a55ee1200ce /src/date.cpp
parent6995365535370da08116d49a30ebd84d56e7d8ff (diff)
downloadopenttd-d0c1a989a4226cc06a50b1a8c95b9ca8f0b9599e.tar.xz
(svn r14047) -Codechange: move chatmessage handling to the network directory as that's the only case chat messages are used. Furthermore remove any trace of chatmessages when compiling without network support.
Diffstat (limited to 'src/date.cpp')
-rw-r--r--src/date.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/date.cpp b/src/date.cpp
index f6f4f19aa..0e99e314a 100644
--- a/src/date.cpp
+++ b/src/date.cpp
@@ -33,10 +33,6 @@ void SetDate(Date date)
ConvertDateToYMD(date, &ymd);
_cur_year = ymd.year;
_cur_month = ymd.month;
-#ifdef ENABLE_NETWORK
- _network_last_advertise_frame = 0;
- _network_need_advertise = true;
-#endif /* ENABLE_NETWORK */
}
#define M(a, b) ((a << 5) | b)
@@ -161,7 +157,6 @@ Date ConvertYMDToDate(Year year, Month month, Day day)
/** Functions used by the IncreaseDate function */
extern void WaypointsDailyLoop();
-extern void ChatMessageDailyLoop();
extern void EnginesDailyLoop();
extern void DisasterDailyLoop();
@@ -228,7 +223,9 @@ void IncreaseDate()
/* yeah, increase day counter and call various daily loops */
_date++;
- ChatMessageDailyLoop();
+#ifdef ENABLE_NETWORK
+ NetworkChatMessageDailyLoop();
+#endif /* ENABLE_NETWORK */
DisasterDailyLoop();
WaypointsDailyLoop();
@@ -296,9 +293,11 @@ void IncreaseDate()
_date -= days_this_year;
FOR_ALL_VEHICLES(v) v->date_of_last_service -= 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 */
- InitChatMessage();
+ NetworkInitChatMessage();
+#endif /* ENABLE_NETWORK */
}
if (_settings_client.gui.auto_euro) CheckSwitchToEuro();