Codechange: Use std::list for News Items. (#12338)
This commit is contained in:
@@ -56,11 +56,12 @@ static void SurveyRecentNews(nlohmann::json &json)
|
||||
json = nlohmann::json::array();
|
||||
|
||||
int i = 0;
|
||||
for (NewsItem *news = _latest_news; i < 32 && news != nullptr; news = news->prev, i++) {
|
||||
TimerGameCalendar::YearMonthDay ymd = TimerGameCalendar::ConvertDateToYMD(news->date);
|
||||
for (const auto &news : GetNews()) {
|
||||
TimerGameCalendar::YearMonthDay ymd = TimerGameCalendar::ConvertDateToYMD(news.date);
|
||||
json.push_back(fmt::format("({}-{:02}-{:02}) StringID: {}, Type: {}, Ref1: {}, {}, Ref2: {}, {}",
|
||||
ymd.year, ymd.month + 1, ymd.day, news->string_id, news->type,
|
||||
news->reftype1, news->ref1, news->reftype2, news->ref2));
|
||||
ymd.year, ymd.month + 1, ymd.day, news.string_id, news.type,
|
||||
news.reftype1, news.ref1, news.reftype2, news.ref2));
|
||||
if (++i > 32) break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user