Updates the fly command so when stopping flying it clears hover state correctly

This commit is contained in:
Madpeter 2020-05-11 12:07:33 +01:00
parent 04a927848c
commit ffe8672f08

View file

@ -1,4 +1,6 @@
namespace BSB.Commands.Movement using System.Threading;
namespace BSB.Commands.Movement
{ {
public class BotFly : CoreCommand_1arg public class BotFly : CoreCommand_1arg
{ {
@ -11,6 +13,12 @@
{ {
if (bool.TryParse(args[0], out bool status) == true) if (bool.TryParse(args[0], out bool status) == true)
{ {
if(status == false)
{
bot.GetClient.Self.Movement.Fly = true;
bot.GetClient.Self.Movement.SendUpdate();
Thread.Sleep(200);
}
bot.GetClient.Self.Movement.Fly = status; bot.GetClient.Self.Movement.Fly = status;
bot.GetClient.Self.Movement.SendUpdate(); bot.GetClient.Self.Movement.SendUpdate();
return true; return true;