Skip to content

Commit

Permalink
Fix Eraser not being able to erase object on background layer
Browse files Browse the repository at this point in the history
relates to #6845
  • Loading branch information
ihhub committed May 18, 2024
1 parent b16754d commit 1eb839e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/fheroes2/maps/maps_tiles_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}
Expand Down

0 comments on commit 1eb839e

Please sign in to comment.