1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Remove excess pointer from market interface

This commit is contained in:
nordsoft
2023-04-27 00:18:43 +04:00
committed by Nordsoft91
parent ac09f78c67
commit 59bc9326e9
10 changed files with 48 additions and 85 deletions

View File

@@ -1709,7 +1709,8 @@ void CPlayerInterface::stopMovement()
void CPlayerInterface::showMarketWindow(const IMarket *market, const CGHeroInstance *visitor)
{
EVENT_HANDLER_CALLED_BY_CLIENT;
if (market->o->ID == Obj::ALTAR_OF_SACRIFICE)
auto * o = dynamic_cast<const CGObjectInstance *>(market);
if(o && o->ID == Obj::ALTAR_OF_SACRIFICE)
{
//EEMarketMode mode = market->availableModes().front();
if (market->allowsTrade(EMarketMode::ARTIFACT_EXP) && visitor->getAlignment() != EAlignment::EVIL)