Merge pull request #2764 from zeddrak/patch-1

HacknetServer Grow/Weaken error messages
This commit is contained in:
hydroflame 2022-01-26 00:42:11 -05:00 committed by GitHub
commit 64662df91e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -143,7 +143,7 @@ export class Terminal implements ITerminal {
startGrow(player: IPlayer): void { startGrow(player: IPlayer): void {
const server = player.getCurrentServer(); const server = player.getCurrentServer();
if (server instanceof HacknetServer) { if (server instanceof HacknetServer) {
this.error("Cannot hack this kind of server"); this.error("Cannot grow this kind of server");
return; return;
} }
if (!(server instanceof Server)) throw new Error("server should be normal server"); if (!(server instanceof Server)) throw new Error("server should be normal server");
@ -152,7 +152,7 @@ export class Terminal implements ITerminal {
startWeaken(player: IPlayer): void { startWeaken(player: IPlayer): void {
const server = player.getCurrentServer(); const server = player.getCurrentServer();
if (server instanceof HacknetServer) { if (server instanceof HacknetServer) {
this.error("Cannot hack this kind of server"); this.error("Cannot weaken this kind of server");
return; return;
} }
if (!(server instanceof Server)) throw new Error("server should be normal server"); if (!(server instanceof Server)) throw new Error("server should be normal server");
@ -241,7 +241,7 @@ export class Terminal implements ITerminal {
if (cancelled) return; if (cancelled) return;
if (server instanceof HacknetServer) { if (server instanceof HacknetServer) {
this.error("Cannot hack this kind of server"); this.error("Cannot grow this kind of server");
return; return;
} }
if (!(server instanceof Server)) throw new Error("server should be normal server"); if (!(server instanceof Server)) throw new Error("server should be normal server");
@ -268,7 +268,7 @@ export class Terminal implements ITerminal {
if (cancelled) return; if (cancelled) return;
if (server instanceof HacknetServer) { if (server instanceof HacknetServer) {
this.error("Cannot hack this kind of server"); this.error("Cannot weaken this kind of server");
return; return;
} }
if (!(server instanceof Server)) throw new Error("server should be normal server"); if (!(server instanceof Server)) throw new Error("server should be normal server");