Fix #2771: Do not change x coordinates of moved card if it will be destroyed when it leaves the table (#4216)

This commit is contained in:
knitknit 2021-01-02 22:45:11 -05:00 committed by GitHub
parent 0457e65751
commit a0deb73df6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -433,6 +433,9 @@ Response::ResponseCode Server_Player::moveCard(GameEventStorage &ges,
lastDrawList.clear();
}
// Only mess about with x coordinates if the card is sticking around, otherwise it can have weird side effects
// if multiple cards are moved at once.
if (!card->getDestroyOnZoneChange()) {
if ((startzone == targetzone) && !startzone->hasCoords()) {
if (!secondHalf && (originalPosition < x)) {
xIndex = -1;
@ -445,6 +448,8 @@ Response::ResponseCode Server_Player::moveCard(GameEventStorage &ges,
} else {
++xIndex;
}
}
int newX = x + xIndex;
// Attachment relationships can be retained when moving a card onto the opponent's table