mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-29 19:13:49 +01:00
fix buying negative memory
This commit is contained in:
parent
2af57cb01e
commit
0306397f53
@ -30,6 +30,7 @@ export function CovenantSleeveMemoryUpgrade(props: IProps): React.ReactElement {
|
|||||||
let n: number = parseInt(e.target.value);
|
let n: number = parseInt(e.target.value);
|
||||||
|
|
||||||
if (isNaN(n)) n = 1;
|
if (isNaN(n)) n = 1;
|
||||||
|
if (n < 1) n = 1;
|
||||||
const maxMemory = 100 - props.sleeve.memory;
|
const maxMemory = 100 - props.sleeve.memory;
|
||||||
if (n > maxMemory) n = maxMemory;
|
if (n > maxMemory) n = maxMemory;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user