From f3f2e6c18bc743e36656be892c93defdf9bf47cc Mon Sep 17 00:00:00 2001 From: Jackson Davis Date: Sat, 4 Apr 2015 18:45:52 -0700 Subject: [PATCH] 66E407: news_item_peep_removed --- src/management/news_item.c | 24 ++++++++++++++++++++++++ src/management/news_item.h | 1 + src/peep/peep.c | 4 ++-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/management/news_item.c b/src/management/news_item.c index f2471cb157..f63d5a26b2 100644 --- a/src/management/news_item.c +++ b/src/management/news_item.c @@ -344,3 +344,27 @@ void news_item_open_subject(int type, int subject) break; } } + +/** + * rct2: 0x0066E407 + */ +void news_item_peep_removed(uint8 type, uint32 sprite_index) { + rct_news_item* newsItem = RCT2_ADDRESS(RCT2_ADDRESS_NEWS_ITEM_LIST, rct_news_item); + while (newsItem->type != NEWS_ITEM_NULL) { + if (type == newsItem->type && sprite_index == 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 = RCT2_ADDRESS(0x013CB2D8, rct_news_item); + while (newsItem->type != NEWS_ITEM_NULL) { + if (type == newsItem->type && sprite_index == newsItem->assoc) { + newsItem->flags |= 0x1; + window_invalidate_by_class(WC_RECENT_NEWS); + } + } +} diff --git a/src/management/news_item.h b/src/management/news_item.h index 8b48e61b6b..27a824ef41 100644 --- a/src/management/news_item.h +++ b/src/management/news_item.h @@ -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_peep_removed(uint8 type, uint32 sprite_index); #endif diff --git a/src/peep/peep.c b/src/peep/peep.c index 0f2d33d86e..3d1d3a347e 100644 --- a/src/peep/peep.c +++ b/src/peep/peep.c @@ -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_peep_removed(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_peep_removed(NEWS_ITEM_PEEP, peep->sprite_index); } sprite_remove((rct_sprite*)peep); }