Changeset - r5520:aa1247f0561e
[Not reviewed]
master
0 1 0
Darkvater - 18 years ago 2007-01-04 17:23:55
darkvater@openttd.org
(svn r7823) -Fix (r7384 / r7368 / r3757 / r7388): News windows could still cause crashes because
DeleteVehicleNews shuffles around _news_items which can wreak havoc with the NewsItem*
of a currently open news window. While here also correctly update _current_news and
_forced_news for the same reasons. Should really work now.
1 file changed with 29 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/news_gui.c
Show inline comments
 
@@ -194,343 +194,350 @@ static void NewsWindowProc(Window *w, Wi
 
		} break;
 
		}
 
	} break;
 

	
 
	case WE_KEYPRESS:
 
		if (e->we.keypress.keycode == WKC_SPACE) {
 
			// Don't continue.
 
			e->we.keypress.cont = false;
 
			DeleteWindow(w);
 
		}
 
		break;
 

	
 
	case WE_MESSAGE: /* The chatbar has notified us that is was either created or closed */
 
		switch (e->we.message.msg) {
 
			case WE_CREATE: w->message.msg = e->we.message.wparam; break;
 
			case WE_DESTROY: w->message.msg = 0; break;
 
		}
 
		break;
 

	
 
	case WE_TICK: { /* Scroll up newsmessages from the bottom in steps of 4 pixels */
 
		int diff;
 
		int y = max(w->top - 4, _screen.height - w->height - 12 - w->message.msg);
 
		if (y == w->top) return;
 

	
 
		if (w->viewport != NULL)
 
			w->viewport->top += y - w->top;
 

	
 
		diff = abs(w->top - y);
 
		w->top = y;
 

	
 
		SetDirtyBlocks(w->left, w->top - diff, w->left + w->width, w->top + w->height);
 
	} break;
 
	}
 
}
 

	
 
/** Return the correct index in the pseudo-fifo
 
 * queue and deals with overflows when increasing the index */
 
static inline NewsID increaseIndex(NewsID i)
 
{
 
	assert(i != INVALID_NEWS);
 
	return (i + 1) % MAX_NEWS;
 
}
 

	
 
/** Return the correct index in the pseudo-fifo
 
 * queue and deals with overflows when decreasing the index */
 
static inline NewsID decreaseIndex(NewsID i)
 
{
 
	assert(i != INVALID_NEWS);
 
	return (i + MAX_NEWS - 1) % MAX_NEWS;
 
}
 

	
 
/** Add a new newsitem to be shown.
 
 * @param string String to display, can have special values based on parameter 'flags'
 
 * @param flags various control bits that will show various news-types. See macro NEWS_FLAGS()
 
 * @param data_a news-specific value based on news type
 
 * @param data_b news-specific value based on news type
 
 * @note flags exists of 4 byte-sized extra parameters.<br/>
 
 * 1.  0 -  7 display_mode, any of the NewsMode enums (NM_)<br/>
 
 * 2.  8 - 15 news flags, any of the NewsFlags enums (NF_) NF_INCOLOR are set automatically if needed<br/>
 
 * 3. 16 - 23 news category, any of the NewsType enums (NT_)<br/>
 
 * 4. 24 - 31 news callback function, any of the NewsCallback enums (DNC_)<br/>
 
 * If the display mode is NM_CALLBACK special news is shown and parameter
 
 * stringid has a special meaning.<br/>
 
 * DNC_TRAINAVAIL, DNC_ROADAVAIL, DNC_SHIPAVAIL, DNC_AIRCRAFTAVAIL: StringID is
 
 * the index of the engine that is shown<br/>
 
 * DNC_BANKRUPCY: bytes 0-3 of StringID contains the player that is in trouble,
 
 * and 4-7 contains what kind of bankrupcy message is shown, NewsBankrupcy enum (NB_)<br/>
 
 * @see NewsMode
 
 * @see NewsFlags
 
 * @see NewsType
 
 * @see NewsCallback */
 
void AddNewsItem(StringID string, uint32 flags, uint data_a, uint data_b)
 
{
 
	NewsID l_news;
 

	
 
	if (_game_mode == GM_MENU) return;
 

	
 
	// check the rare case that the oldest (to be overwritten) news item is open
 
	if (_total_news == MAX_NEWS && (_oldest_news == _current_news || _oldest_news == _forced_news))
 
		MoveToNextItem();
 

	
 
	_forced_news = INVALID_NEWS;
 
	if (_total_news < MAX_NEWS) _total_news++;
 

	
 
	/* Increase _latest_news. If we have no news yet, use _oldest news as an
 
	 * index. We cannot use 0 as _oldest_news can jump around due to
 
	 * DeleteVehicleNews */
 
	l_news = _latest_news;
 
	_latest_news = (_latest_news == INVALID_NEWS) ? _oldest_news : increaseIndex(_latest_news);
 

	
 
	/* If the fifo-buffer is full, overwrite the oldest entry */
 
	if (l_news != INVALID_NEWS && _latest_news == _oldest_news) {
 
		assert(_total_news == MAX_NEWS);
 
		_oldest_news = increaseIndex(_oldest_news);
 
	}
 

	
 
	/*DEBUG(misc, 0) ("+cur %3d, old %2d, lat %3d, for %3d, tot %2d",
 
	  _current_news, _oldest_news, _latest_news, _forced_news, _total_news); */
 

	
 
	{ /* Add news to _latest_news */
 
		Window *w;
 
		NewsItem *ni = &_news_items[_latest_news];
 
		memset(ni, 0, sizeof(*ni));
 

	
 
		ni->string_id = string;
 
		ni->display_mode = (byte)flags;
 
		ni->flags = (byte)(flags >> 8);
 

	
 
		// show this news message in color?
 
		if (_cur_year >= _patches.colored_news_year) ni->flags |= NF_INCOLOR;
 

	
 
		ni->type = (byte)(flags >> 16);
 
		ni->callback = (byte)(flags >> 24);
 
		ni->data_a = data_a;
 
		ni->data_b = data_b;
 
		ni->date = _date;
 
		COPY_OUT_DPARAM(ni->params, 0, lengthof(ni->params));
 

	
 
		w = FindWindowById(WC_MESSAGE_HISTORY, 0);
 
		if (w == NULL) return;
 
		SetWindowDirty(w);
 
		w->vscroll.count = _total_news;
 
	}
 
}
 

	
 

	
 
// don't show item if it's older than x days
 
/* Don't show item if it's older than x days, corresponds with NewsType in news.h */
 
static const byte _news_items_age[] = {60, 60, 90, 60, 90, 30, 150, 30, 90, 180};
 

	
 
static const Widget _news_type13_widgets[] = {
 
{      WWT_PANEL,   RESIZE_NONE,    15,     0,   429,     0,   169, 0x0, STR_NULL},
 
{      WWT_PANEL,   RESIZE_NONE,    15,     0,    10,     0,    11, 0x0, STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static WindowDesc _news_type13_desc = {
 
	WDP_CENTER, 476, 430, 170,
 
	WC_NEWS_WINDOW, 0,
 
	WDF_DEF_WIDGET,
 
	_news_type13_widgets,
 
	NewsWindowProc
 
};
 

	
 
static const Widget _news_type2_widgets[] = {
 
{      WWT_PANEL,   RESIZE_NONE,    15,     0,   429,     0,   129, 0x0, STR_NULL},
 
{      WWT_PANEL,   RESIZE_NONE,    15,     0,    10,     0,    11, 0x0, STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static WindowDesc _news_type2_desc = {
 
	WDP_CENTER, 476, 430, 130,
 
	WC_NEWS_WINDOW, 0,
 
	WDF_DEF_WIDGET,
 
	_news_type2_widgets,
 
	NewsWindowProc
 
};
 

	
 
static const Widget _news_type0_widgets[] = {
 
{      WWT_PANEL,   RESIZE_NONE,     5,     0,   279,    14,    86, 0x0,              STR_NULL},
 
{   WWT_CLOSEBOX,   RESIZE_NONE,     5,     0,    10,     0,    13, STR_00C5,         STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,   RESIZE_NONE,     5,    11,   279,     0,    13, STR_012C_MESSAGE, STR_NULL},
 
{      WWT_INSET,   RESIZE_NONE,     5,     2,   277,    16,    64, 0x0,              STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static WindowDesc _news_type0_desc = {
 
	WDP_CENTER, 476, 280, 87,
 
	WC_NEWS_WINDOW, 0,
 
	WDF_DEF_WIDGET,
 
	_news_type0_widgets,
 
	NewsWindowProc
 
};
 

	
 
static const SoundFx _news_sounds[] = {
 
	SND_1D_APPLAUSE,
 
	SND_1D_APPLAUSE,
 
	0,
 
	0,
 
	0,
 
	0,
 
	SND_1E_OOOOH,
 
	0,
 
	0,
 
	0
 
};
 

	
 
/** Get the value of an item of the news-display settings. This is
 
 * a little tricky since on/off/summary must use 2 bits to store the value
 
 * @param item the item whose value is requested
 
 * @return return the found value which is between 0-2
 
 */
 
static inline byte GetNewsDisplayValue(byte item)
 
{
 
	assert(item < 10 && GB(_news_display_opt, item * 2, 2) <= 2);
 
	return GB(_news_display_opt, item * 2, 2);
 
}
 

	
 
/** Set the value of an item in the news-display settings. This is
 
 * a little tricky since on/off/summary must use 2 bits to store the value
 
 * @param item the item whose value is being set
 
 * @param val new value
 
 */
 
static inline void SetNewsDisplayValue(byte item, byte val)
 
{
 
	assert(item < 10 && val <= 2);
 
	SB(_news_display_opt, item * 2, 2, val);
 
}
 

	
 
// open up an own newspaper window for the news item
 
static void ShowNewspaper(NewsItem *ni)
 
{
 
	Window *w;
 
	SoundFx sound;
 
	int top;
 
	ni->flags &= ~NF_FORCE_BIG;
 
	ni->duration = 555;
 

	
 
	sound = _news_sounds[ni->type];
 
	if (sound != 0) SndPlayFx(sound);
 

	
 
	top = _screen.height;
 
	switch (ni->display_mode) {
 
		case NM_NORMAL:
 
		case NM_CALLBACK: {
 
			_news_type13_desc.top = top;
 
			w = AllocateWindowDesc(&_news_type13_desc);
 
			if (ni->flags & NF_VIEWPORT)
 
				AssignWindowViewport(w, 2, 58, 0x1AA, 0x6E,
 
					ni->data_a | (ni->flags & NF_VEHICLE ? 0x80000000 : 0), 0);
 
			break;
 
		}
 

	
 
		case NM_THIN: {
 
			_news_type2_desc.top = top;
 
			w = AllocateWindowDesc(&_news_type2_desc);
 
			if (ni->flags & NF_VIEWPORT)
 
				AssignWindowViewport(w, 2, 58, 0x1AA, 0x46,
 
					ni->data_a | (ni->flags & NF_VEHICLE ? 0x80000000 : 0), 0);
 
			break;
 
		}
 

	
 
		default: {
 
			_news_type0_desc.top = top;
 
			w = AllocateWindowDesc(&_news_type0_desc);
 
			if (ni->flags & NF_VIEWPORT)
 
				AssignWindowViewport(w, 3, 17, 0x112, 0x2F,
 
					ni->data_a | (ni->flags & NF_VEHICLE ? 0x80000000 : 0), 0);
 
			break;
 
		}
 
	}
 

	
 
	/*DEBUG(misc, 0) (" cur %3d, old %2d, lat %3d, for %3d, tot %2d",
 
	  _current_news, _oldest_news, _latest_news, _forced_news, _total_news); */
 

	
 
	WP(w, news_d).ni = &_news_items[_forced_news == INVALID_NEWS ? _current_news : _forced_news];
 
	w->flags4 |= WF_DISABLE_VP_SCROLL;
 
}
 

	
 
// show news item in the ticker
 
static void ShowTicker(const NewsItem *ni)
 
{
 
	Window *w;
 

	
 
	if (_news_ticker_sound) SndPlayFx(SND_16_MORSE);
 

	
 
	_statusbar_news_item = *ni;
 
	w = FindWindowById(WC_STATUS_BAR, 0);
 
	if (w != NULL) WP(w, def_d).data_1 = 360;
 
}
 

	
 

	
 
// Are we ready to show another news item?
 
// Only if nothing is in the newsticker and no newspaper is displayed
 
static bool ReadyForNextItem(void)
 
{
 
	const Window *w;
 
	NewsID item = (_forced_news == INVALID_NEWS) ? _current_news : _forced_news;
 
	NewsItem *ni;
 

	
 
	if (item >= MAX_NEWS) return true;
 
	ni = &_news_items[item];
 

	
 
	// Ticker message
 
	// Check if the status bar message is still being displayed?
 
	w = FindWindowById(WC_STATUS_BAR, 0);
 
	if (w != NULL && WP(w, const def_d).data_1 > -1280) return false;
 

	
 
	// Newspaper message, decrement duration counter
 
	if (ni->duration != 0) ni->duration--;
 

	
 
	// neither newsticker nor newspaper are running
 
	return (ni->duration == 0 || FindWindowById(WC_NEWS_WINDOW, 0) == NULL);
 
}
 

	
 
static void MoveToNextItem(void)
 
{
 
	DeleteWindowById(WC_NEWS_WINDOW, 0);
 
	_forced_news = INVALID_NEWS;
 

	
 
	// if we're not at the last item, then move on
 
	if (_current_news != _latest_news) {
 
		NewsItem *ni;
 

	
 
		_current_news = (_current_news == INVALID_NEWS) ? _oldest_news : increaseIndex(_current_news);
 
		ni = &_news_items[_current_news];
 

	
 
		// check the date, don't show too old items
 
		if (_date - _news_items_age[ni->type] > ni->date) return;
 

	
 
		switch (GetNewsDisplayValue(ni->type)) {
 
		case 0: { /* Off - show nothing only a small reminder in the status bar */
 
			Window *w = FindWindowById(WC_STATUS_BAR, 0);
 

	
 
			if (w != NULL) {
 
				WP(w, def_d).data_2 = 91;
 
				SetWindowDirty(w);
 
			}
 
			break;
 
		}
 

	
 
		case 1: /* Summary - show ticker, but if forced big, cascade to full */
 
			if (!(ni->flags & NF_FORCE_BIG)) {
 
				ShowTicker(ni);
 
				break;
 
			}
 
			/* Fallthrough */
 

	
 
		case 2: /* Full - show newspaper*/
 
			ShowNewspaper(ni);
 
			break;
 
		}
 
	}
 
}
 

	
 
void NewsLoop(void)
 
{
 
	// no news item yet
 
	if (_total_news == 0) return;
 

	
 
	if (ReadyForNextItem()) MoveToNextItem();
 
}
 

	
 
/* Do a forced show of a specific message */
 
static void ShowNewsMessage(NewsID i)
 
{
 
	if (_total_news == 0) return;
 

	
 
	// Delete the news window
 
	DeleteWindowById(WC_NEWS_WINDOW, 0);
 

	
 
@@ -792,131 +799,143 @@ static void MessageOptionsWndProc(Window
 
		} break;
 
		} break;
 

	
 
	case WE_DROPDOWN_SELECT: {/* Select all settings for newsmessages */
 
		int i;
 

	
 
		WP(w, def_d).data_2 = e->we.dropdown.index;
 

	
 
		for (i = 0; i != 10; i++) {
 
			SB(_news_display_opt, i*2, 2, e->we.dropdown.index);
 
			SetMessageButtonStates(w, e->we.dropdown.index, i);
 
		}
 
		SetWindowDirty(w);
 
		break;
 
		}
 

	
 
	case WE_TIMEOUT: /* XXX - Hack to animate 'fake' buttons */
 
		WP(w, def_d).data_1 = 0;
 
		SetWindowDirty(w);
 
		break;
 
	}
 
}
 

	
 
static const Widget _message_options_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,    13,     0,   10,     0,    13, STR_00C5,                 STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,   RESIZE_NONE,    13,    11,  409,     0,    13, STR_0204_MESSAGE_OPTIONS, STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{      WWT_PANEL,   RESIZE_NONE,    13,     0,  409,    14,   184, 0x0,                      STR_NULL},
 

	
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    26,    37, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    26,    37, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
 

	
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    38,    49, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    38,    49, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
 

	
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    50,    61, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    50,    61, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
 

	
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    62,    73, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    62,    73, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
 

	
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    74,    85, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    74,    85, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
 

	
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    86,    97, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    86,    97, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
 

	
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    98,   109, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    98,   109, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
 

	
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,   110,   121, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,   110,   121, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
 

	
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,   122,   133, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,   122,   133, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
 

	
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,   134,   145, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,   134,   145, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
 

	
 
{      WWT_PANEL,   RESIZE_NONE,     3,     4,   86,   154,   165, 0x0,                      STR_NULL},
 
{    WWT_TEXTBTN,   RESIZE_NONE,     3,    87,   98,   154,   165, STR_0225,                 STR_NULL},
 
{  WWT_TEXTBTN_2,   RESIZE_NONE,     3,     4,   98,   166,   177, STR_02DB_OFF,             STR_NULL},
 

	
 
{      WWT_LABEL,   RESIZE_NONE,    13,     0,  409,    13,    26, STR_0205_MESSAGE_TYPES,   STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _message_options_desc = {
 
	270, 22, 410, 185,
 
	WC_GAME_OPTIONS, 0,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_message_options_widgets,
 
	MessageOptionsWndProc
 
};
 

	
 
void ShowMessageOptions(void)
 
{
 
	DeleteWindowById(WC_GAME_OPTIONS, 0);
 
	AllocateWindowDesc(&_message_options_desc);
 
}
 

	
 

	
 
void DeleteVehicleNews(VehicleID vid, StringID news)
 
{
 
	NewsID n;
 

	
 
	for (n = _oldest_news; _latest_news != INVALID_NEWS; n = increaseIndex(n)) {
 
		const NewsItem *ni = &_news_items[n];
 

	
 
		if (ni->flags & NF_VEHICLE &&
 
				ni->data_a == vid &&
 
				(news == INVALID_STRING_ID || ni->string_id == news)) {
 
			Window *w;
 

	
 
			if (_forced_news == n || _current_news == n) MoveToNextItem();
 
			_total_news--;
 

	
 
			// If this is the last news item, invalidate _latest_news
 
			if (_latest_news == _oldest_news) {
 
				assert(_total_news == 0);
 
			/* If this is the last news item, invalidate _latest_news */
 
			if (_total_news == 0) {
 
				assert(_latest_news == _oldest_news);
 
				_latest_news = INVALID_NEWS;
 
			}
 

	
 
			/* Since we only imitate a FIFO removing an arbitrary element does need
 
			 * some magic. Remove the item by shifting head towards the tail. eg
 
			 *    oldest    remove  last
 
			 *        |        |     |
 
			 * [------O--------n-----L--]
 
			 * will become (change dramatized to make clear)
 
			 * [---------O-----------L--]
 
			 * Also update the current news item in case it was pointing to the
 
			 * oldest, now shifted item */
 
			 * We also need an update of the current, forced and visible (open window)
 
			 * news's as this shifting could change the items they were pointing to */
 
			if (_total_news != 0) {
 
				NewsID i;
 
				for (i = n; i != _oldest_news; i = decreaseIndex(i)) {
 
				NewsID i, visible_news;
 
				w = FindWindowById(WC_NEWS_WINDOW, 0);
 
				visible_news = (w != NULL) ? (NewsID)(WP(w, news_d).ni - _news_items) : INVALID_NEWS;
 

	
 
				i = n;
 
				do {
 
					_news_items[i] = _news_items[decreaseIndex(i)];
 
				}
 

	
 
				if (_current_news == _oldest_news) _current_news = increaseIndex(_current_news);
 
					if (i == _current_news) _current_news = increaseIndex(_current_news);
 
					if (i == _forced_news) _forced_news = increaseIndex(_forced_news);
 
					if (i == visible_news) WP(w, news_d).ni = &_news_items[increaseIndex(visible_news)];
 

	
 
					i = decreaseIndex(i);
 
				} while (i != _oldest_news);
 

	
 
				_oldest_news = increaseIndex(_oldest_news);
 
			}
 

	
 
			/*DEBUG(misc, 0) ("-cur %3d, old %2d, lat %3d, for %3d, tot %2d",
 
			  _current_news, _oldest_news, _latest_news, _forced_news, _total_news); */
 

	
 
			w = FindWindowById(WC_MESSAGE_HISTORY, 0);
 
			if (w != NULL) {
 
				SetWindowDirty(w);
 
				w->vscroll.count = _total_news;
 
			}
 
		}
 

	
 
		if (n == _latest_news) break;
 
	}
 
}
0 comments (0 inline, 0 general)