Token PT is now set to DB values if not defined in event.

This commit is contained in:
Matt Lowe 2014-10-01 19:20:42 +02:00
parent a80ccd882c
commit e3a94ecca3

View file

@ -1092,13 +1092,12 @@ void Player::eventCreateToken(const Event_CreateToken &event)
return;
CardItem *card = new CardItem(this, QString::fromStdString(event.card_name()), event.card_id());
card->setColor(QString::fromStdString(event.color()));
// 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
// use db PT if not provided in event
if (!QString::fromStdString(event.pt()).isEmpty())
card->setPT(QString::fromStdString(event.pt()));
else
card->setPT(db->getCard(QString::fromStdString(event.card_name()))->getPowTough());
card->setColor(QString::fromStdString(event.color()));
card->setAnnotation(QString::fromStdString(event.annotation()));
card->setDestroyOnZoneChange(event.destroy_on_zone_change());