Skip to content

Commit

Permalink
Add extra assertions and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ihhub committed Oct 20, 2024
1 parent 96ff4ed commit e5bc9a6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/fheroes2/world/world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@ MapsIndexes World::GetTeleportEndPoints( const int32_t index ) const

const Maps::TilesAddon * entranceObjectPart = Maps::getObjectPartByActionType( entranceTile, MP2::OBJ_STONE_LITHS );
if ( entranceObjectPart == nullptr ) {
// This tile is marked as Stone Liths but somehow it doesn't even have whirlpool's object parts.
assert( 0 );
return result;
}
Expand Down Expand Up @@ -836,6 +837,8 @@ MapsIndexes World::GetWhirlpoolEndPoints( const int32_t index ) const

const Maps::TilesAddon * entranceObjectPart = Maps::getObjectPartByActionType( entranceTile, MP2::OBJ_WHIRLPOOL );
if ( entranceObjectPart == nullptr ) {
// This tile is marked as Whirlpool but somehow it doesn't even have whirlpool's object parts.
assert( 0 );
return result;
}

Expand All @@ -847,6 +850,8 @@ MapsIndexes World::GetWhirlpoolEndPoints( const int32_t index ) const

const Maps::TilesAddon * destinationObjectPart = Maps::getObjectPartByActionType( whirlpoolTile, MP2::OBJ_WHIRLPOOL );
if ( destinationObjectPart == nullptr ) {
// This tile is marked as Whirlpool but somehow it doesn't even have whirlpool's object parts.
assert( 0 );
continue;
}

Expand Down

0 comments on commit e5bc9a6

Please sign in to comment.