diff --git a/MinecraftClient/Bots.cs b/MinecraftClient/Bots.cs
index c7312724..11797727 100644
--- a/MinecraftClient/Bots.cs
+++ b/MinecraftClient/Bots.cs
@@ -217,6 +217,15 @@ namespace MinecraftClient
Program.Restart();
}
+ ///
+ /// Disconnect from the server and exit the program
+ ///
+
+ protected void DisconnectAndExit()
+ {
+ Program.Exit();
+ }
+
///
/// Unload the chatbot, and release associated memory.
///
@@ -899,7 +908,7 @@ namespace MinecraftClient
sleepticks = ticks;
break;
case "disconnect":
- Program.Exit();
+ DisconnectAndExit();
break;
case "exit": //Exit bot & stay connected to the server
UnloadBot();
@@ -911,6 +920,7 @@ namespace MinecraftClient
else
{
//No more instructions to interpret
+ UnloadBot();
}
}
}