mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -07:00
update client event processing
This commit is contained in:
parent
6110d2a996
commit
66619cf453
1 changed files with 3 additions and 2 deletions
|
|
@ -2232,10 +2232,10 @@ void Player::eventCreateToken(const Event_CreateToken &event)
|
|||
|
||||
CardItem *card = new CardItem(this, nullptr, QString::fromStdString(event.card_name()),
|
||||
QString::fromStdString(event.card_provider_id()), event.card_id());
|
||||
// use db PT if not provided in event
|
||||
// use db PT if not provided in event and not face-down
|
||||
if (!QString::fromStdString(event.pt()).isEmpty()) {
|
||||
card->setPT(QString::fromStdString(event.pt()));
|
||||
} else {
|
||||
} else if (!event.face_down()) {
|
||||
CardInfoPtr dbCard = card->getInfo();
|
||||
if (dbCard) {
|
||||
card->setPT(dbCard->getPowTough());
|
||||
|
|
@ -2244,6 +2244,7 @@ void Player::eventCreateToken(const Event_CreateToken &event)
|
|||
card->setColor(QString::fromStdString(event.color()));
|
||||
card->setAnnotation(QString::fromStdString(event.annotation()));
|
||||
card->setDestroyOnZoneChange(event.destroy_on_zone_change());
|
||||
card->setFaceDown(event.face_down());
|
||||
|
||||
emit logCreateToken(this, card->getName(), card->getPT());
|
||||
zone->addCard(card, true, event.x(), event.y());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue