Merge branch 'master' into jgrpp
# Conflicts: # src/bridge_map.h # src/crashlog.cpp # src/industry.h # src/linkgraph/linkgraph_type.h # src/order_type.h # src/saveload/afterload.cpp # src/settings.cpp # src/settings_type.h # src/smallmap_gui.cpp # src/spritecache.cpp # src/stdafx.h # src/table/settings.h.preamble # src/train.h # src/vehicle.cpp # src/viewport.cpp # src/viewport_func.h # src/widgets/station_widget.h # src/zoom_func.h # src/zoom_type.h
This commit is contained in:
@@ -335,7 +335,7 @@ char *CrashLog::LogGamelog(char *buffer, const char *last) const
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes any recent news messages to the buffer.
|
||||
* Writes up to 32 recent news messages to the buffer, with the most recent first.
|
||||
* @param buffer The begin where to write at.
|
||||
* @param last The last position in the buffer to write to.
|
||||
* @return the position of the \c '\0' character after the buffer.
|
||||
@@ -343,18 +343,14 @@ char *CrashLog::LogGamelog(char *buffer, const char *last) const
|
||||
char *CrashLog::LogRecentNews(char *buffer, const char *last) const
|
||||
{
|
||||
uint total = 0;
|
||||
for (NewsItem *news = _oldest_news; news != nullptr; news = news->next) {
|
||||
for (NewsItem *news = _latest_news; news != nullptr; news = news->next) {
|
||||
total++;
|
||||
}
|
||||
uint show = min<uint>(total, 32);
|
||||
buffer += seprintf(buffer, last, "Recent news messages (%u of %u):\n", show, total);
|
||||
|
||||
uint skip = total - show;
|
||||
for (NewsItem *news = _oldest_news; news != nullptr; news = news->next) {
|
||||
if (skip) {
|
||||
skip--;
|
||||
continue;
|
||||
}
|
||||
int i = 0;
|
||||
for (NewsItem *news = _latest_news; i < 32 && news != nullptr; news = news->prev, i++) {
|
||||
YearMonthDay ymd;
|
||||
ConvertDateToYMD(news->date, &ymd);
|
||||
buffer += seprintf(buffer, last, "(%i-%02i-%02i) StringID: %u, Type: %u, Ref1: %u, %u, Ref2: %u, %u\n",
|
||||
|
Reference in New Issue
Block a user