Skip to content

Commit

Permalink
Show mines over water
Browse files Browse the repository at this point in the history
based on the feedback

Also, change some comments.

relates to #6845
  • Loading branch information
ihhub committed May 18, 2024
1 parent b16754d commit 6398c9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
9 changes: 1 addition & 8 deletions src/fheroes2/editor/editor_interface_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ namespace Interface
[type = getSelectedObjectType(), group = getSelectedObjectGroup()]( const int32_t /*tileIndex*/ ) { setCustomCursor( group, type ); } );
return;
case AdventureObjectBrush::MINES:
_interface.setCursorUpdater( [this]( const int32_t tileIndex ) {
_interface.setCursorUpdater( [this]( const int32_t /*tileIndex*/ ) {
int32_t type = -1;
int32_t color = -1;
getMineObjectProperties( type, color );
Expand All @@ -835,13 +835,6 @@ namespace Interface
return;
}

if ( world.GetTiles( tileIndex ).GetGround() == Maps::Ground::WATER ) {
// Mines cannot be placed on water.
const fheroes2::Sprite & image = fheroes2::AGG::GetICN( ICN::SPELLS, 0 );
Cursor::Get().setCustomImage( image, { -image.width() / 2, -image.height() / 2 } );
return;
}

assert( Maps::getObjectsByGroup( Maps::ObjectGroup::ADVENTURE_MINES ).size() > static_cast<size_t>( type ) );

// TODO: Implement a function to render also the owner flag after ownership selection is implemented.
Expand Down
3 changes: 2 additions & 1 deletion src/fheroes2/maps/map_format_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ namespace Maps::Map_Format

uint8_t computerPlayerColors{ 0 };

// Does this event occur only once?
// Does this event occur more than once?
bool isRecurringEvent{ false };

// An artifact to be given as a reward.
Expand Down Expand Up @@ -222,6 +222,7 @@ namespace Maps::Map_Format

uint32_t firstOccurrenceDay{ 0 };

// Repeat period for the event. 0 value means no repetition.
uint32_t repeatPeriodInDays{ 0 };

// Resources to be given as a reward.
Expand Down

0 comments on commit 6398c9b

Please sign in to comment.