mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-29 04:17:05 +02:00
Fix hostname generation being weird about dash 0 added
This commit is contained in:
@@ -23,7 +23,9 @@ export function safetlyCreateUniqueServer(params: IConstructorParams): Server {
|
||||
}
|
||||
|
||||
if (GetServer(hostname) != null) {
|
||||
hostname = `${hostname}-0`;
|
||||
if (hostname.slice(-2) != `-0`) {
|
||||
hostname = `${hostname}-0`;
|
||||
}
|
||||
|
||||
// Use a for loop to ensure that we don't get suck in an infinite loop somehow
|
||||
for (let i = 0; i < 200; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user