Skip to content

Commit

Permalink
Restrict object types
Browse files Browse the repository at this point in the history
  • Loading branch information
ihhub committed Jan 29, 2025
1 parent 50af433 commit d138563
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/fheroes2/editor/editor_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,10 @@ namespace
return false;
}

if ( MP2::isOffGameActionObject( objectPart.objectType ) && MP2::isPickupObject( objectPart.objectType ) && !Maps::isClearGround( tile ) ) {
// We are trying to place a pickup action object on a tile that has some other objects.
// Since, pickup objects are tend to be removed we are not allowing to put them on top of 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;
}
}
Expand Down

0 comments on commit d138563

Please sign in to comment.