Skip to content

Commit

Permalink
fix js error
Browse files Browse the repository at this point in the history
  • Loading branch information
7underlines committed Aug 17, 2024
1 parent 9eb3a97 commit 3d6f1dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion www/assets/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const playerLoadStats = () => {
player.exp.expPercent = Number((player.exp.expCurrLvl / player.exp.expMaxLvl) * 100).toFixed(2).replace(rx, "$1");

// Generate battle info for player if in combat
if (player.inCombat || playerDead) {
if (player.inCombat || (typeof playerDead !== 'undefined' && playerDead)) {
const playerCombatHpElement = document.querySelector('#player-hp-battle');
const playerHpDamageElement = document.querySelector('#player-hp-dmg');
const playerExpElement = document.querySelector('#player-exp-bar');
Expand Down
2 changes: 1 addition & 1 deletion www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ <h4>Equipment</h4>
<script src="./assets/js/music.js"></script>
<script src="./assets/js/player.js"></script>
<script src="./assets/js/equipment.js"></script>
<script src="./assets/js/combat.js" type="module"></script>
<script src="./assets/js/combat.js"></script>
<script src="./assets/js/dungeon.js"></script>
<script src="./assets/js/enemy.js"></script>
<script src="./assets/js/main.js"></script>
Expand Down

0 comments on commit 3d6f1dd

Please sign in to comment.