Commit a80ccd88 authored by Matt Lowe's avatar Matt Lowe
Browse files

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.
parent ab7f354e
......@@ -1093,7 +1093,12 @@ void Player::eventCreateToken(const Event_CreateToken &event)
CardItem *card = new CardItem(this, QString::fromStdString(event.card_name()), event.card_id());
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->setDestroyOnZoneChange(event.destroy_on_zone_change());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment