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:
parent
0457e65751
commit
a0deb73df6
1 changed files with 13 additions and 8 deletions
|
@ -433,18 +433,23 @@ Response::ResponseCode Server_Player::moveCard(GameEventStorage &ges,
|
||||||
lastDrawList.clear();
|
lastDrawList.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((startzone == targetzone) && !startzone->hasCoords()) {
|
// Only mess about with x coordinates if the card is sticking around, otherwise it can have weird side effects
|
||||||
if (!secondHalf && (originalPosition < x)) {
|
// if multiple cards are moved at once.
|
||||||
xIndex = -1;
|
if (!card->getDestroyOnZoneChange()) {
|
||||||
secondHalf = true;
|
if ((startzone == targetzone) && !startzone->hasCoords()) {
|
||||||
} else if (secondHalf) {
|
if (!secondHalf && (originalPosition < x)) {
|
||||||
--xIndex;
|
xIndex = -1;
|
||||||
|
secondHalf = true;
|
||||||
|
} else if (secondHalf) {
|
||||||
|
--xIndex;
|
||||||
|
} else {
|
||||||
|
++xIndex;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
++xIndex;
|
++xIndex;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
++xIndex;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int newX = x + xIndex;
|
int newX = x + xIndex;
|
||||||
|
|
||||||
// Attachment relationships can be retained when moving a card onto the opponent's table
|
// Attachment relationships can be retained when moving a card onto the opponent's table
|
||||||
|
|
Loading…
Reference in a new issue