Trading now works with bank limits
Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
parent
3823b3d50b
commit
81df996e48
@ -373,11 +373,18 @@ const Trade = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isTurn) {
|
if (isTurn) {
|
||||||
activeTrades.forEach(offer => offer.valid = !(turn.color in offer.offerRejected) && canMeetOffer(priv, offer));
|
activeTrades.forEach(offer => {
|
||||||
|
if (offer.name === 'The bank') {
|
||||||
|
/* offer has to be the second parameter for the bank to match */
|
||||||
|
offer.valid = isCompatibleOffer({ gives: trade.gets, gets: trade.gives }, offer);
|
||||||
|
} else {
|
||||||
|
offer.valid = !(turn.color in offer.offerRejected) && canMeetOffer(priv, offer);
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
const found = activeTrades.find(item => item.name === turn.name);
|
const found = activeTrades.find(item => item.name === turn.name);
|
||||||
if (found) {
|
if (found) {
|
||||||
found.valid = !(color in found.offerRejected) && canMeetOffer(priv, found);
|
found.valid = !(color in found.offerRejected) && isCompatibleOffer(priv, found);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2298,6 +2298,7 @@ const placeSettlement = (game, session, index) => {
|
|||||||
|
|
||||||
sendUpdateToPlayers(game, {
|
sendUpdateToPlayers(game, {
|
||||||
placements: game.placements,
|
placements: game.placements,
|
||||||
|
activities: game.activities,
|
||||||
turn: game.turn,
|
turn: game.turn,
|
||||||
chat: game.chat
|
chat: game.chat
|
||||||
});
|
});
|
||||||
@ -2789,6 +2790,7 @@ const placeCity = (game, session, index) => {
|
|||||||
private: session.player
|
private: session.player
|
||||||
});
|
});
|
||||||
sendUpdateToPlayers(game, {
|
sendUpdateToPlayers(game, {
|
||||||
|
placements: game.placements,
|
||||||
turn: game.turn,
|
turn: game.turn,
|
||||||
chat: game.chat,
|
chat: game.chat,
|
||||||
activities: game.activities
|
activities: game.activities
|
||||||
|
Loading…
x
Reference in New Issue
Block a user