From c96d1613d817e158caeb4b3e0b5dff31aca92f96 Mon Sep 17 00:00:00 2001 From: Francisco Franco Eslava Date: Mon, 7 Oct 2019 14:29:48 +0200 Subject: [PATCH] Diceless characters now aren't ignored. Fixes #282 --- src/AppBundle/Model/SlotCollectionDecorator.php | 6 +++--- src/AppBundle/Resources/public/js/app.deck.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/AppBundle/Model/SlotCollectionDecorator.php b/src/AppBundle/Model/SlotCollectionDecorator.php index 39b5bdf3..2ef47754 100644 --- a/src/AppBundle/Model/SlotCollectionDecorator.php +++ b/src/AppBundle/Model/SlotCollectionDecorator.php @@ -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; } } @@ -237,7 +237,7 @@ public function getCharacterPoints() } else { - $inc = intval($formatPoints) * $slot->getDice(); + $inc = intval($formatPoints) * $slot->getQuantity(); } $points += $inc; diff --git a/src/AppBundle/Resources/public/js/app.deck.js b/src/AppBundle/Resources/public/js/app.deck.js index 4fc560ae..4bf13f11 100755 --- a/src/AppBundle/Resources/public/js/app.deck.js +++ b/src/AppBundle/Resources/public/js/app.deck.js @@ -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);