From e5bc9a60a46946622dc80bce5250573cc684920c Mon Sep 17 00:00:00 2001 From: Ihar Hubchyk Date: Sun, 20 Oct 2024 15:06:15 +0800 Subject: [PATCH] Add extra assertions and comments --- src/fheroes2/world/world.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fheroes2/world/world.cpp b/src/fheroes2/world/world.cpp index 15496ad7da..ffef1049ae 100644 --- a/src/fheroes2/world/world.cpp +++ b/src/fheroes2/world/world.cpp @@ -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; } @@ -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; } @@ -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; }