Skip to content

Commit 84294ee

Browse files
committed
Merge pull request #59 from Databean/fixedTrading
Fixed trading
2 parents 93eafc4 + 1e5ee14 commit 84294ee

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/GameController.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,10 +490,10 @@ bool GameController::handleTradeOffer(ScreenCoordinate coord, Player& initiating
490490
std::array<int, 5> splitOffer;
491491
std::array<int, 5> splitDemand;
492492
for(int i = 0; i < 5; i++) {
493-
splitOffer[i] = counterOffer[i] < 0 ? 0 : -counterOffer[i];
493+
splitOffer[i] = counterOffer[i] > 0 ? 0 : -counterOffer[i];
494494
splitDemand[i] = counterOffer[i] < 0 ? 0 : counterOffer[i];
495495
}
496-
initiating.acceptOffer(receiving, splitOffer, splitDemand);
496+
initiating.acceptOffer(receiving, splitDemand, splitOffer);
497497
} else {
498498
//std::function<bool(std::array<int, 5>, ScreenCoordinate)> tradeFunction(std::bind(&GameController::handleTradeOffer, this, _2, std::ref(initiating), _1, std::ref(receiving)));
499499
std::function<bool(std::array<int, 5>, ScreenCoordinate)> tradeFunction([this, &initiating, &receiving, counterOffer](std::array<int, 5> offer, ScreenCoordinate coord) {

src/GameView.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ void TradingView::render() {
748748
auto font = getGraphicsConfig()["font.path"];
749749
auto fontSize = getGraphicsConfig()["font.size"];
750750

751-
std::string resources[] = {"Wood", "Brick", "Ore", "Wheat", "Wool"};
751+
std::string resources[] = {"Wheat", "Wool", "Ore", "Brick", "Wood"};
752752
for(int i = 0; i < 5; i++) {
753753
auto leftX = getGraphicsConfig()["screen.tradingView.resources.leftX"];
754754
auto rightX = getGraphicsConfig()["screen.tradingView.resources.rightX"];

0 commit comments

Comments
 (0)