diff --git a/CCallback.cpp b/CCallback.cpp index 019ecfbe4..54ab49a9d 100644 --- a/CCallback.cpp +++ b/CCallback.cpp @@ -212,27 +212,27 @@ void CCallback::buyArtifact(const CGHeroInstance *hero, ArtifactID aid) sendRequest(&pack); } -void CCallback::trade(const CGObjectInstance *market, EMarketMode::EMarketMode mode, int id1, int id2, int val1, const CGHeroInstance *hero) +void CCallback::trade(const CGObjectInstance *market, EMarketMode::EMarketMode mode, ui32 id1, ui32 id2, ui32 val1, const CGHeroInstance *hero) { TradeOnMarketplace pack; pack.market = market; pack.hero = hero; pack.mode = mode; - pack.r1 = std::vector{static_cast(id1)}; - pack.r2 = std::vector{static_cast(id2)}; - pack.val = std::vector{static_cast(val1)}; + pack.r1 = {id1}; + pack.r2 = {id2}; + pack.val = {val1}; sendRequest(&pack); } -void CCallback::trade(const CGObjectInstance *market, EMarketMode::EMarketMode mode, std::vector id1, std::vector id2, std::vector val1, const CGHeroInstance *hero) +void CCallback::trade(const CGObjectInstance *market, EMarketMode::EMarketMode mode, std::vector id1, std::vector id2, std::vector val1, const CGHeroInstance *hero) { TradeOnMarketplace pack; pack.market = market; pack.hero = hero; pack.mode = mode; - pack.r1 = std::vector(id1.begin(), id1.end()); - pack.r2 = std::vector(id2.begin(), id2.end()); - pack.val = std::vector(val1.begin(), val1.end()); + pack.r1 = id1; + pack.r2 = id2; + pack.val = val1; sendRequest(&pack); } diff --git a/CCallback.h b/CCallback.h index 0bbc0cea0..76169ffc1 100644 --- a/CCallback.h +++ b/CCallback.h @@ -56,8 +56,8 @@ public: virtual bool upgradeCreature(const CArmedInstance *obj, SlotID stackPos, CreatureID newID=CreatureID::NONE)=0; //if newID==-1 then best possible upgrade will be made virtual void swapGarrisonHero(const CGTownInstance *town)=0; - virtual void trade(const CGObjectInstance *market, EMarketMode::EMarketMode mode, int id1, int id2, int val1, const CGHeroInstance *hero = nullptr)=0; //mode==0: sell val1 units of id1 resource for id2 resiurce - virtual void trade(const CGObjectInstance *market, EMarketMode::EMarketMode mode, std::vector id1, std::vector id2, std::vector val1, const CGHeroInstance *hero = nullptr)=0; + virtual void trade(const CGObjectInstance *market, EMarketMode::EMarketMode mode, ui32 id1, ui32 id2, ui32 val1, const CGHeroInstance *hero = nullptr)=0; //mode==0: sell val1 units of id1 resource for id2 resiurce + virtual void trade(const CGObjectInstance *market, EMarketMode::EMarketMode mode, std::vector id1, std::vector id2, std::vector val1, const CGHeroInstance *hero = nullptr)=0; virtual int selectionMade(int selection, QueryID queryID) =0; virtual int sendQueryReply(const JsonNode & reply, QueryID queryID) =0; @@ -139,8 +139,8 @@ public: void endTurn() override; void swapGarrisonHero(const CGTownInstance *town) override; void buyArtifact(const CGHeroInstance *hero, ArtifactID aid) override; - void trade(const CGObjectInstance *market, EMarketMode::EMarketMode mode, int id1, int id2, int val1, const CGHeroInstance *hero = nullptr) override; - void trade(const CGObjectInstance *market, EMarketMode::EMarketMode mode, std::vector id1, std::vector id2, std::vector val1, const CGHeroInstance *hero = nullptr) override; + void trade(const CGObjectInstance *market, EMarketMode::EMarketMode mode, ui32 id1, ui32 id2, ui32 val1, const CGHeroInstance *hero = nullptr) override; + void trade(const CGObjectInstance *market, EMarketMode::EMarketMode mode, std::vector id1, std::vector id2, std::vector val1, const CGHeroInstance *hero = nullptr) override; void setFormation(const CGHeroInstance * hero, bool tight) override; void recruitHero(const CGObjectInstance *townOrTavern, const CGHeroInstance *hero) override; void save(const std::string &fname) override; diff --git a/client/windows/CTradeWindow.cpp b/client/windows/CTradeWindow.cpp index 0a6b057f3..e10765b70 100644 --- a/client/windows/CTradeWindow.cpp +++ b/client/windows/CTradeWindow.cpp @@ -1231,8 +1231,8 @@ void CAltarWindow::makeDeal() blockTrade(); slider->moveTo(0); - std::vector ids; - std::vector toSacrifice; + std::vector ids; + std::vector toSacrifice; for (int i = 0; i < sacrificedUnits.size(); i++) { @@ -1256,7 +1256,7 @@ void CAltarWindow::makeDeal() } else { - std::vector positions; + std::vector positions; for(const CArtifactInstance *art : arts->artifactsOnAltar) //sacrifice each artifact on the list { positions.push_back(hero->getArtPos(art));