Remove the logic to update Troll's Bridge passability after visiting it (#9420)

This commit is contained in:
Ihar Hubchyk
2025-01-08 12:03:41 +08:00
committed by GitHub
parent 0077ff2842
commit 20d59ebb91
4 changed files with 2 additions and 18 deletions
+1 -2
View File
@@ -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) 2010 by Andrey Afletdinov <[email protected]> *
@@ -1479,7 +1479,6 @@ namespace
// Set ownership of the dwelling to a Neutral (gray) player so that any player can recruit troops without a fight.
setColorOnTile( tile, Color::UNUSED );
tile.SetObjectPassable( true );
}
else {
AIBattleLose( hero, res, true );
+1 -2
View File
@@ -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 <[email protected]> *
@@ -2466,7 +2466,6 @@ namespace
// Set ownership of the dwelling to a Neutral (gray) player so that any player can recruit troops without a fight.
setColorOnTile( tile, Color::UNUSED );
tile.SetObjectPassable( true );
if ( fheroes2::showStandardTextMessage( title, victoryMsg, Dialog::YES | Dialog::NO ) == Dialog::YES ) {
const Troop troop = getTroopFromTile( tile );
-12
View File
@@ -1085,18 +1085,6 @@ bool Maps::Tile::isPassableFrom( const int direction, const bool fromWater, cons
return ( direction & _tilePassabilityDirections ) != 0;
}
void Maps::Tile::SetObjectPassable( bool pass )
{
if ( getMainObjectType( false ) == MP2::OBJ_TROLL_BRIDGE ) {
if ( pass ) {
_tilePassabilityDirections |= Direction::TOP_LEFT;
}
else {
_tilePassabilityDirections &= ~Direction::TOP_LEFT;
}
}
}
bool Maps::Tile::isStream() const
{
for ( const auto & part : _groundObjectPart ) {
-2
View File
@@ -283,8 +283,6 @@ namespace Maps
void ClearFog( const int colors );
void SetObjectPassable( bool pass );
const std::array<uint32_t, 3> & metadata() const
{
return _metadata;