mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-19 04:35:46 +01:00
fix crash when renaming server while connected to that server (#438)
This commit is contained in:
parent
39d26673c4
commit
a774592e64
@ -68,6 +68,7 @@ export const renamePurchasedServer = (hostname: string, newName: string): void =
|
||||
return arr.map((v) => (v === old ? next : v));
|
||||
};
|
||||
Player.purchasedServers = replace(Player.purchasedServers, hostname, newName);
|
||||
if (Player.currentServer === hostname) Player.currentServer = newName;
|
||||
const home = Player.getHomeComputer();
|
||||
home.serversOnNetwork = replace(home.serversOnNetwork, hostname, newName);
|
||||
server.serversOnNetwork = replace(server.serversOnNetwork, hostname, newName);
|
||||
|
Loading…
Reference in New Issue
Block a user