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
commit31d69a49e87e1388c4cfdbccb7d256572283d308 (patch)
tree96b3b7c215db821df9b9268eb9af5a55ee1200ce /src/date.cpp
parent122f029b9387c0834fdc1e9b75c09abf6ebf024e (diff)
downloadopenttd-31d69a49e87e1388c4cfdbccb7d256572283d308.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();