Skip to content

Commit

Permalink
hotfix trial selection #595
Browse files Browse the repository at this point in the history
  • Loading branch information
Lurkars committed Oct 29, 2024
1 parent eec4657 commit 922553e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/ui/figures/character/sheet/character-sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,15 +523,15 @@ export class CharacterSheetComponent implements OnInit, AfterViewInit {
if (settingsManager.settings.fhSecondEdition) {
trial = gameManager.trialsManager.cardIdSecondPrinting(trial);
}
if (!this.character.progress.trial || this.character.progress.trial.name != '' + trial) {
if (!this.character.progress.trial || this.character.progress.trial.name != event.target.value) {

const editionData = gameManager.editionData.find((editionData) => editionData.edition == gameManager.currentEdition() && editionData.trials && editionData.trials.length);
if (editionData) {
const trialCard = editionData.trials.find((trialCard) => trialCard.cardId == trial && trialCard.edition == gameManager.currentEdition());
if (trialCard) {
event.target.classList.remove('error');
event.target.classList.add('warning');
if (!gameManager.game.figures.find((figure) => figure instanceof Character && figure.progress.trial && figure.progress.trial.edition == gameManager.currentEdition() && figure.progress.trial.name == '' + +event.target.value)) {
if (!gameManager.game.figures.find((figure) => figure instanceof Character && figure.progress.trial && figure.progress.trial.edition == gameManager.currentEdition() && figure.progress.trial.name == event.target.value)) {
gameManager.stateManager.before("setTrial", gameManager.characterManager.characterName(this.character), event.target.value);
this.character.progress.trial = new Identifier('' + trial, gameManager.currentEdition());
const currentTrialIndex = Math.max(...gameManager.game.figures.filter((figure) => figure instanceof Character).map((character) =>
Expand Down

0 comments on commit 922553e

Please sign in to comment.