diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index b4170f99a..cc83c4b52 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -1709,22 +1709,15 @@ void CPlayerInterface::stopMovement() void CPlayerInterface::showMarketWindow(const IMarket *market, const CGHeroInstance *visitor) { EVENT_HANDLER_CALLED_BY_CLIENT; - auto * o = dynamic_cast(market); - if(o && o->ID == Obj::ALTAR_OF_SACRIFICE) - { - //EEMarketMode mode = market->availableModes().front(); - if (market->allowsTrade(EMarketMode::ARTIFACT_EXP) && visitor->getAlignment() != EAlignment::EVIL) - GH.pushIntT(market, visitor, EMarketMode::ARTIFACT_EXP); - else if (market->allowsTrade(EMarketMode::CREATURE_EXP) && visitor->getAlignment() != EAlignment::GOOD) - GH.pushIntT(market, visitor, EMarketMode::CREATURE_EXP); - } - else - { - if(market->allowsTrade(EMarketMode::CREATURE_UNDEAD)) - GH.pushIntT(market, visitor); - else - GH.pushIntT(market, visitor, market->availableModes().front()); - } + + if(market->allowsTrade(EMarketMode::ARTIFACT_EXP) && visitor->getAlignment() != EAlignment::EVIL) + GH.pushIntT(market, visitor, EMarketMode::ARTIFACT_EXP); + else if(market->allowsTrade(EMarketMode::CREATURE_EXP) && visitor->getAlignment() != EAlignment::GOOD) + GH.pushIntT(market, visitor, EMarketMode::CREATURE_EXP); + else if(market->allowsTrade(EMarketMode::CREATURE_UNDEAD)) + GH.pushIntT(market, visitor); + else if(!market->availableModes().empty()) + GH.pushIntT(market, visitor, market->availableModes().front()); } void CPlayerInterface::showUniversityWindow(const IMarket *market, const CGHeroInstance *visitor)