From 1eb839ea1040cd7a2b4ef81b0f97d7080d24a115 Mon Sep 17 00:00:00 2001 From: Ihar Hubchyk Date: Sat, 18 May 2024 23:41:24 +0800 Subject: [PATCH] Fix Eraser not being able to erase object on background layer relates to #6845 --- src/fheroes2/maps/maps_tiles_helper.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fheroes2/maps/maps_tiles_helper.cpp b/src/fheroes2/maps/maps_tiles_helper.cpp index 16312320a15..7dd901fa99a 100644 --- a/src/fheroes2/maps/maps_tiles_helper.cpp +++ b/src/fheroes2/maps/maps_tiles_helper.cpp @@ -3205,18 +3205,19 @@ namespace Maps for ( int32_t x = startX; x <= endX; ++x ) { const Maps::Tiles & currentTile = world.GetTiles( x + tileOffset ); - if ( currentTile.GetObjectUID() != 0 && ( currentTile.getLayerType() == OBJECT_LAYER || currentTile.getLayerType() == TERRAIN_LAYER ) ) { + if ( currentTile.GetObjectUID() != 0 && ( currentTile.getLayerType() != SHADOW_LAYER ) ) { objectsUids.insert( currentTile.GetObjectUID() ); } for ( const Maps::TilesAddon & addon : currentTile.getBottomLayerAddons() ) { - if ( addon._uid != 0 && ( addon._layerType == OBJECT_LAYER || addon._layerType == TERRAIN_LAYER ) ) { + if ( addon._uid != 0 && ( addon._layerType != SHADOW_LAYER ) ) { objectsUids.insert( addon._uid ); } } for ( const Maps::TilesAddon & addon : currentTile.getTopLayerAddons() ) { - if ( addon._uid != 0 && ( addon._layerType == OBJECT_LAYER || addon._layerType == TERRAIN_LAYER ) ) { + // Top layer addons don't have layer type. + if ( addon._uid != 0 ) { objectsUids.insert( addon._uid ); } }