Skip to content

Commit

Permalink
Diceless characters now aren't ignored. Fixes fafranco82#282
Browse files Browse the repository at this point in the history
  • Loading branch information
fafranco82 committed Oct 7, 2019
1 parent 5364f69 commit c96d161
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/AppBundle/Model/SlotCollectionDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ public function getCharacterRow()
if($slot->getCard()->getIsUnique()) {
$characterRow[] = $slot;
} else {
$totalDice = $slot->getDice();
$totalCards = $slot->getQuantity();
$slot->setDice(1);
$slot->setQuantity(1);
for($i = 0; $i < $totalDice; $i++) {
for($i = 0; $i < $totalCards; $i++) {
$characterRow[] = $slot;
}
}
Expand Down Expand Up @@ -237,7 +237,7 @@ public function getCharacterPoints()
}
else
{
$inc = intval($formatPoints) * $slot->getDice();
$inc = intval($formatPoints) * $slot->getQuantity();
}

$points += $inc;
Expand Down
2 changes: 1 addition & 1 deletion src/AppBundle/Resources/public/js/app.deck.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ deck.get_character_points = function get_character_points() {
if(character.is_unique) {
return points + parseInt(character.points.split('/')[character.indeck.dice-1], 10);
} else {
return points + parseInt(character.points, 10) * character.indeck.dice;
return points + parseInt(character.points, 10) * character.indeck.cards;
}
}, 0);

Expand Down

0 comments on commit c96d161

Please sign in to comment.