mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-17 07:52:16 -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()),
|
CardItem *card = new CardItem(this, nullptr, QString::fromStdString(event.card_name()),
|
||||||
QString::fromStdString(event.card_provider_id()), event.card_id());
|
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()) {
|
if (!QString::fromStdString(event.pt()).isEmpty()) {
|
||||||
card->setPT(QString::fromStdString(event.pt()));
|
card->setPT(QString::fromStdString(event.pt()));
|
||||||
} else {
|
} else if (!event.face_down()) {
|
||||||
CardInfoPtr dbCard = card->getInfo();
|
CardInfoPtr dbCard = card->getInfo();
|
||||||
if (dbCard) {
|
if (dbCard) {
|
||||||
card->setPT(dbCard->getPowTough());
|
card->setPT(dbCard->getPowTough());
|
||||||
|
|
@ -2244,6 +2244,7 @@ void Player::eventCreateToken(const Event_CreateToken &event)
|
||||||
card->setColor(QString::fromStdString(event.color()));
|
card->setColor(QString::fromStdString(event.color()));
|
||||||
card->setAnnotation(QString::fromStdString(event.annotation()));
|
card->setAnnotation(QString::fromStdString(event.annotation()));
|
||||||
card->setDestroyOnZoneChange(event.destroy_on_zone_change());
|
card->setDestroyOnZoneChange(event.destroy_on_zone_change());
|
||||||
|
card->setFaceDown(event.face_down());
|
||||||
|
|
||||||
emit logCreateToken(this, card->getName(), card->getPT());
|
emit logCreateToken(this, card->getName(), card->getPT());
|
||||||
zone->addCard(card, true, event.x(), event.y());
|
zone->addCard(card, true, event.x(), event.y());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue