From d0c1a989a4226cc06a50b1a8c95b9ca8f0b9599e Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 11 Aug 2008 22:45:11 +0000 Subject: (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. --- src/date.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/date.cpp') 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(); -- cgit v1.2.3-54-g00ecf