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

market->getObjInstanceID()

This commit is contained in:
SoundSSGood
2024-08-20 17:15:50 +03:00
parent 58bb2b58e3
commit 2e3e6b1553
27 changed files with 77 additions and 61 deletions

View File

@@ -184,7 +184,7 @@ void ApplyGhNetPackVisitor::visitExchangeArtifacts(ExchangeArtifacts & pack)
void ApplyGhNetPackVisitor::visitBulkExchangeArtifacts(BulkExchangeArtifacts & pack)
{
if(dynamic_cast<const IMarket*>(gh.getObj(pack.srcHero)) == nullptr)
if(gh.getMarket(pack.srcHero) == nullptr)
gh.throwIfWrongOwner(&pack, pack.srcHero);
if(pack.swap)
gh.throwIfWrongOwner(&pack, pack.dstHero);
@@ -250,7 +250,7 @@ void ApplyGhNetPackVisitor::visitTradeOnMarketplace(TradeOnMarketplace & pack)
{
const CGObjectInstance * object = gh.getObj(pack.marketId);
const CGHeroInstance * hero = gh.getHero(pack.heroId);
const auto * market = dynamic_cast<const IMarket*>(object);
const auto * market = gh.getMarket(pack.marketId);
gh.throwIfWrongPlayer(&pack);
gh.throwIfPlayerNotActive(&pack);