diff --git a/src/ui/CharacterStats.tsx b/src/ui/CharacterStats.tsx index 43df51bcd..abc7e6a08 100644 --- a/src/ui/CharacterStats.tsx +++ b/src/ui/CharacterStats.tsx @@ -82,13 +82,12 @@ function CurrentBitNode(): React.ReactElement { const player = use.Player(); if (player.sourceFiles.length > 0) { const index = "BitNode" + player.bitNodeN; - const currentSourceFile = player.sourceFiles.find((sourceFile) => sourceFile.n == player.bitNodeN); - const lvl = currentSourceFile ? currentSourceFile.lvl : 0; + const lvl = player.sourceFileLvl(player.bitNodeN) + 1; return ( - BitNode {player.bitNodeN}: {BitNodes[index].name} (Level {lvl + 1}) + BitNode {player.bitNodeN}: {BitNodes[index].name} (Level {lvl}) {BitNodes[index].info}