commit
924bbb2245
1 changed files with 7 additions and 2 deletions
|
@ -1138,11 +1138,13 @@ void Player::actCreateRelatedCard()
|
||||||
|
|
||||||
// removes p/t from tokens (and leading space))
|
// removes p/t from tokens (and leading space))
|
||||||
QStringList spaces = action->text().split(" ");
|
QStringList spaces = action->text().split(" ");
|
||||||
|
|
||||||
if (spaces.at(0).indexOf("/") != -1) // Strip space from creatures
|
if (spaces.at(0).indexOf("/") != -1) // Strip space from creatures
|
||||||
spaces.removeFirst();
|
spaces.removeFirst();
|
||||||
|
|
||||||
CardInfo *cardInfo = db->getCard(spaces.join(" "));
|
CardInfo *cardInfo = db->getCard(spaces.join(" "));
|
||||||
|
|
||||||
|
// get the target token's location
|
||||||
|
// TODO: Define this QPoint into its own function along with the one below
|
||||||
|
QPoint gridPoint = QPoint(-1, table->clampValidTableRow(2 - cardInfo->getTableRow()));
|
||||||
|
|
||||||
// create the token for the related card
|
// create the token for the related card
|
||||||
Command_CreateToken cmd;
|
Command_CreateToken cmd;
|
||||||
|
@ -1153,6 +1155,9 @@ void Player::actCreateRelatedCard()
|
||||||
cmd.set_annotation(settingsCache->getAnnotateTokens() ? cardInfo->getText().toStdString() : QString().toStdString());
|
cmd.set_annotation(settingsCache->getAnnotateTokens() ? cardInfo->getText().toStdString() : QString().toStdString());
|
||||||
cmd.set_destroy_on_zone_change(true);
|
cmd.set_destroy_on_zone_change(true);
|
||||||
cmd.set_target_zone(sourceCard->getZone()->getName().toStdString());
|
cmd.set_target_zone(sourceCard->getZone()->getName().toStdString());
|
||||||
|
cmd.set_x(gridPoint.x());
|
||||||
|
cmd.set_y(gridPoint.y());
|
||||||
|
|
||||||
if(!cardInfo->getIsToken())
|
if(!cardInfo->getIsToken())
|
||||||
cmd.set_target_card_id(sourceCard->getId());
|
cmd.set_target_card_id(sourceCard->getId());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue