mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 08:22:15 -07:00
move card to play before creating attached token
This commit is contained in:
parent
01d5e58a5f
commit
d2d6615d0f
2 changed files with 11 additions and 3 deletions
|
|
@ -1930,7 +1930,15 @@ bool Player::createRelatedFromRelation(const CardItem *sourceCard, const CardRel
|
|||
createCard(sourceCard, dbName, CardRelation::DoesNotAttach, persistent);
|
||||
}
|
||||
} else {
|
||||
createCard(sourceCard, dbName, cardRelation->getAttachType(), persistent);
|
||||
auto attachType = cardRelation->getAttachType();
|
||||
|
||||
// move card onto table first if attaching from some other zone
|
||||
// we only do this for AttachTo because cross-zone TransformInto is already handled server-side
|
||||
if (attachType == CardRelation::AttachTo && sourceCard->getZone()->getName() != "table") {
|
||||
playCardToTable(sourceCard, false);
|
||||
}
|
||||
|
||||
createCard(sourceCard, dbName, attachType, persistent);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -2754,7 +2762,7 @@ void Player::playCard(CardItem *card, bool faceDown)
|
|||
* Like {@link Player::playCard}, but forces the card to be played to the table zone.
|
||||
* Cards with tablerow 3 (the stack) will be played to tablerow 1 (the noncreatures row).
|
||||
*/
|
||||
void Player::playCardToTable(CardItem *card, bool faceDown)
|
||||
void Player::playCardToTable(const CardItem *card, bool faceDown)
|
||||
{
|
||||
if (card == nullptr) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -402,7 +402,7 @@ public:
|
|||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
||||
|
||||
void playCard(CardItem *c, bool faceDown);
|
||||
void playCardToTable(CardItem *c, bool faceDown);
|
||||
void playCardToTable(const CardItem *c, bool faceDown);
|
||||
void addCard(CardItem *c);
|
||||
void deleteCard(CardItem *c);
|
||||
void addZone(CardZone *z);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue