Skip to content

Commit

Permalink
fix(combat): fix some errors on combat page
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Sep 22, 2023
1 parent e6bbbde commit 02eba34
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/src/app/pages/combat/combat.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,15 @@ export class CombatPage implements OnInit {
}

public get defenders(): IFightCharacter[] {
if (!this.fight) return [];

return this.fight.defenders.map((character) => {
return this.fightCharacters[character.characterId];
});
}

public get charge(): number {
return this.fight.generatedCharge ?? 0;
return this.fight?.generatedCharge ?? 0;
}

public get specialGaugeLeft(): number {
Expand Down Expand Up @@ -199,6 +201,8 @@ export class CombatPage implements OnInit {
}

findTileWithCharacter(characterId: string): [number, number] | undefined {
if (!this.fight) return [-1, -1];

let foundTile: [number, number] | undefined;

this.fight.tiles.forEach((row, y) => {
Expand Down

0 comments on commit 02eba34

Please sign in to comment.