diff --git a/src/fheroes2/editor/editor_interface.cpp b/src/fheroes2/editor/editor_interface.cpp index 89b0cdd048..541ea16dc9 100644 --- a/src/fheroes2/editor/editor_interface.cpp +++ b/src/fheroes2/editor/editor_interface.cpp @@ -185,8 +185,10 @@ namespace return false; } - if ( MP2::isOffGameActionObject( objectPart.objectType ) && !Maps::isClearGround( tile ) ) { - // We are trying to place an action object on a tile that has some other objects. + if ( MP2::isOffGameActionObject( objectPart.objectType ) && MP2::getActionObjectPassability( objectPart.objectType ) == DIRECTION_ALL + && !Maps::isClearGround( tile ) ) { + // We are trying to place a "movable" action object on a tile that has some other objects. + // Since, "movable" objects are tend to be removed we do not allow to put them on top of other objects. return false; } } diff --git a/src/fheroes2/maps/maps_tiles.cpp b/src/fheroes2/maps/maps_tiles.cpp index 7688f68acd..4282114c5f 100644 --- a/src/fheroes2/maps/maps_tiles.cpp +++ b/src/fheroes2/maps/maps_tiles.cpp @@ -658,7 +658,7 @@ int Maps::Tile::getTileIndependentPassability() const if ( MP2::isOffGameActionObject( type ) ) { // This is an action object part. isActionObject = true; - return MP2::getActionObjectDirection( type ); + return MP2::getActionObjectPassability( type ); } if ( type == MP2::OBJ_REEFS ) { diff --git a/src/fheroes2/maps/mp2.cpp b/src/fheroes2/maps/mp2.cpp index 46b69e6dac..1168125990 100644 --- a/src/fheroes2/maps/mp2.cpp +++ b/src/fheroes2/maps/mp2.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * fheroes2: https://github.com/ihhub/fheroes2 * - * Copyright (C) 2019 - 2024 * + * Copyright (C) 2019 - 2025 * * * * Free Heroes2 Engine: http://sourceforge.net/projects/fheroes2 * * Copyright (C) 2009 by Andrey Afletdinov * @@ -799,7 +799,7 @@ bool MP2::isNeedStayFront( const MapObjectType objectType ) return isPickupObject( objectType ); } -int MP2::getActionObjectDirection( const MapObjectType objectType ) +int MP2::getActionObjectPassability( const MapObjectType objectType ) { switch ( objectType ) { case OBJ_ARTIFACT: diff --git a/src/fheroes2/maps/mp2.h b/src/fheroes2/maps/mp2.h index 7a5578ec0b..3c581210fa 100644 --- a/src/fheroes2/maps/mp2.h +++ b/src/fheroes2/maps/mp2.h @@ -534,7 +534,7 @@ namespace MP2 bool isBattleLife( const MapObjectType objectType ); // Make sure that you pass a valid action object. - int getActionObjectDirection( const MapObjectType objectType ); + int getActionObjectPassability( const MapObjectType objectType ); bool getDiggingHoleSprite( const int terrainType, ObjectIcnType & objectIcnType, uint8_t & index ); bool isDiggingHoleSprite( const int terrainType, const ObjectIcnType objectIcnType, const uint8_t index );