From d46ee075838c5f853c2d2c4c12f6e69a77eb9099 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sun, 3 Sep 2023 21:30:59 +0300 Subject: [PATCH] Add mapper_destroy_highlight_obj --- src/mapper/mapper.cc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/mapper/mapper.cc b/src/mapper/mapper.cc index ff3d184..2902444 100644 --- a/src/mapper/mapper.cc +++ b/src/mapper/mapper.cc @@ -48,6 +48,7 @@ static void redraw_toolname(); static void clear_toolname(); static void update_toolname(int* pid, int type, int id); static void update_high_obj_name(Object* obj); +static void mapper_destroy_highlight_obj(Object** a1, Object** a2); static int mapper_mark_exit_grid(); static void mapper_mark_all_exit_grids(); @@ -1501,6 +1502,28 @@ void update_high_obj_name(Object* obj) } } +// 0x48B680 +void mapper_destroy_highlight_obj(Object** a1, Object** a2) +{ + Rect rect; + int elevation; + + if (a2 != NULL && *a2 != NULL) { + elevation = (*a2)->elevation; + reg_anim_clear(*a2); + objectDestroy(*a2, &rect); + tileWindowRefreshRect(&rect, elevation); + *a2 = NULL; + } + + if (a1 != NULL && *a1 != NULL) { + elevation = (*a1)->elevation; + objectDestroy(*a1, &rect); + tileWindowRefreshRect(&rect, elevation); + *a1 = NULL; + } +} + // 0x48C604 int mapper_inven_unwield(Object* obj, int right_hand) {