Tweak max SF level code

This commit is contained in:
nickofolas 2022-05-07 16:28:01 -05:00
parent d43ec1d501
commit 5d89f17e4a
2 changed files with 7 additions and 2 deletions

@ -34,7 +34,12 @@ export function BitnodeMultiplierDescription({ n, level }: IProps): React.ReactE
export const BitNodeMultipliersDisplay = ({ n, level }: IProps): React.ReactElement => {
const player = use.Player();
const mults = getBitNodeMultipliers(n, level ?? Math.min(player.sourceFileLvl(n) + 1, n === 12 ? Infinity : 3));
// If a level argument has been provided, use that as the multiplier level
// If not, then we have to assume that we want the next level up from the
// current node's source file, so we get the min of that, the SF's max level,
// or if it's BN12, ∞
const maxSfLevel = n === 12 ? Infinity : 3;
const mults = getBitNodeMultipliers(n, level ?? Math.min(player.sourceFileLvl(n) + 1, maxSfLevel));
return (
<Box sx={{ columnCount: 2, columnGap: 1, mb: -2 }}>

@ -83,7 +83,7 @@ function CurrentBitNode(): React.ReactElement {
const player = use.Player();
if (player.sourceFiles.length > 0) {
const index = "BitNode" + player.bitNodeN;
const lvl = player.sourceFileLvl(player.bitNodeN) + 1;
const lvl = Math.min(player.sourceFileLvl(player.bitNodeN) + 1, player.bitNodeN === 12 ? Infinity : 3);
return (
<Paper sx={{ mb: 1, p: 1 }}>
<Typography variant="h5">