diff --git a/CCallback.cpp b/CCallback.cpp index 8dadf5252..c5b69f558 100644 --- a/CCallback.cpp +++ b/CCallback.cpp @@ -208,21 +208,14 @@ void CCallback::buyArtifact(const CGHeroInstance *hero, ArtifactID aid) void CCallback::trade(const CGObjectInstance * market, EMarketMode::EMarketMode mode, ui32 id1, ui32 id2, ui32 val1, const CGHeroInstance * hero) { - TradeOnMarketplace pack; - pack.marketId = market->id; - pack.heroId = hero->id; - pack.mode = mode; - pack.r1 = {id1}; - pack.r2 = {id2}; - pack.val = {val1}; - sendRequest(&pack); + trade(market, mode, std::vector(1, id1), std::vector(1, id2), std::vector(1, val1), hero); } void CCallback::trade(const CGObjectInstance * market, EMarketMode::EMarketMode mode, const std::vector & id1, const std::vector & id2, const std::vector & val1, const CGHeroInstance * hero) { TradeOnMarketplace pack; pack.marketId = market->id; - pack.heroId = hero->id; + pack.heroId = hero ? hero->id : ObjectInstanceID(); pack.mode = mode; pack.r1 = id1; pack.r2 = id2;