Tokens use PT levels from cards.xml if available
I added a check to see if the event PT is empty, if it is, we try and use the PT from the cards.xml. In resp to issue #330.
This commit is contained in:
parent
ab7f354e36
commit
a80ccd882c
1 changed files with 6 additions and 1 deletions
|
@ -1093,7 +1093,12 @@ void Player::eventCreateToken(const Event_CreateToken &event)
|
||||||
|
|
||||||
CardItem *card = new CardItem(this, QString::fromStdString(event.card_name()), event.card_id());
|
CardItem *card = new CardItem(this, QString::fromStdString(event.card_name()), event.card_id());
|
||||||
card->setColor(QString::fromStdString(event.color()));
|
card->setColor(QString::fromStdString(event.color()));
|
||||||
card->setPT(QString::fromStdString(event.pt()));
|
|
||||||
|
// use db p/t if not provided in event
|
||||||
|
if (QString::fromStdString(event.pt()).isEmpty())
|
||||||
|
card->setPT(db->getCard(QString::fromStdString(event.card_name()))->getPowTough());
|
||||||
|
else
|
||||||
|
card->setPT(QString::fromStdString(event.pt()));
|
||||||
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());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue