Merge pull request #998 from jcdavis/66E407

66E407: news_item_peep_removed
This commit is contained in:
Ted John 2015-04-06 19:59:36 +01:00
commit cbde35402c
3 changed files with 31 additions and 2 deletions

View File

@ -28,6 +28,8 @@
#include "../world/sprite.h"
#include "news_item.h"
rct_news_item *newsItems = RCT2_ADDRESS(RCT2_ADDRESS_NEWS_ITEM_LIST, rct_news_item);
void window_game_bottom_toolbar_invalidate_news_item();
static int news_item_get_new_history_slot();
@ -344,3 +346,29 @@ void news_item_open_subject(int type, int subject)
break;
}
}
/**
* rct2: 0x0066E407
*/
void news_item_disable_news(uint8 type, uint32 assoc) {
rct_news_item* newsItem = newsItems;
while (newsItem->type != NEWS_ITEM_NULL) {
if (type == newsItem->type && assoc == newsItem->assoc) {
newsItem->flags |= 0x1;
if (newsItem == RCT2_ADDRESS(RCT2_ADDRESS_NEWS_ITEM_LIST, rct_news_item)) {
window_game_bottom_toolbar_invalidate_news_item();
}
}
newsItem++;
}
newsItem = &newsItems[11]; //0x13CB2D8
while (newsItem->type != NEWS_ITEM_NULL) {
if (type == newsItem->type && assoc == newsItem->assoc) {
newsItem->flags |= 0x1;
window_invalidate_by_class(WC_RECENT_NEWS);
}
newsItem++;
}
}

View File

@ -58,5 +58,6 @@ void news_item_close_current();
void news_item_get_subject_location(int type, int subject, int *x, int *y, int *z);
void news_item_add_to_queue(uint8 type, rct_string_id string_id, uint32 assoc);
void news_item_open_subject(int type, int subject);
void news_item_disable_news(uint8 type, uint32 assoc);
#endif

View File

@ -567,7 +567,7 @@ void peep_sprite_remove(rct_peep* peep){
if (peep->type == PEEP_TYPE_GUEST){
window_invalidate_by_class(WC_GUEST_LIST);
RCT2_CALLPROC_X(0x0066E407, 2, 0, peep->sprite_index, 0, 0, 0, 0);
news_item_disable_news(NEWS_ITEM_PEEP_ON_RIDE, peep->sprite_index);
}
else{
window_invalidate_by_class(WC_STAFF_LIST);
@ -577,7 +577,7 @@ void peep_sprite_remove(rct_peep* peep){
sub_6C0C3F();
peep->type = PEEP_TYPE_STAFF;
RCT2_CALLPROC_X(0x0066E407, 3, 0, peep->sprite_index, 0, 0, 0, 0);
news_item_disable_news(NEWS_ITEM_PEEP, peep->sprite_index);
}
sprite_remove((rct_sprite*)peep);
}