From 2e14e4620eab4556f6dcfe6889d4aa3dceae9fa4 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Tue, 21 Jan 2025 22:58:04 +0300 Subject: [PATCH] Remove text floaters after moving to another map or elevation Fixes #401 --- src/map.cc | 3 +++ src/object.cc | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/map.cc b/src/map.cc index a2ffbd1a..63685018 100644 --- a/src/map.cc +++ b/src/map.cc @@ -1255,6 +1255,9 @@ int mapHandleTransition() } else { if (!isInCombat()) { if (gMapTransition.map != gMapHeader.field_34 || gElevation == gMapTransition.elevation) { + // SFALL: Remove text floaters after moving to another map. + textObjectsReset(); + mapLoadById(gMapTransition.map); } diff --git a/src/object.cc b/src/object.cc index 93486443..58b41317 100644 --- a/src/object.cc +++ b/src/object.cc @@ -1476,6 +1476,9 @@ int objectSetLocation(Object* obj, int tile, int elevation, Rect* rect) } if (elevation != oldElevation) { + // SFALL: Remove text floaters after moving to another elevation. + textObjectsReset(); + mapSetElevation(elevation); tileSetCenter(tile, TILE_SET_CENTER_REFRESH_WINDOW | TILE_SET_CENTER_FLAG_IGNORE_SCROLL_RESTRICTIONS); if (isInCombat()) {