Fix %CALL HORSE

This commit is contained in:
Li 2022-05-08 17:17:00 +12:00
parent 4fd4fcb652
commit 479b539b44

View file

@ -782,17 +782,27 @@ namespace HISP.Game.Chat
if (!user.Administrator) if (!user.Administrator)
return false; return false;
if (args.Length >= 1) if (args.Length <= 0)
if (args[0].ToUpper() != "HORSE") return;
return false;
string formattedmessage = Messages.FormatPlayerCommandCompleteMessage(message); try
{
WildHorse horse = WildHorse.WildHorses[GameServer.RandomNumberGenerator.Next(0, WildHorse.WildHorses.Length)]; if (args[0].ToUpper() != "HORSE")
horse.X = user.X; return false;
horse.Y = user.Y;
string formattedmessage = Messages.FormatPlayerCommandCompleteMessage(message);
GameServer.UpdateAreaForAll(user.X, user.Y);
WildHorse horse = WildHorse.WildHorses[GameServer.RandomNumberGenerator.Next(0, WildHorse.WildHorses.Length)];
horse.X = user.X;
horse.Y = user.Y;
GameServer.UpdateAreaForAll(user.X, user.Y);
}
catch (Exception)
{
return false;
}
byte[] chatPacket = PacketBuilder.CreateChat(formattedmessage, PacketBuilder.CHAT_BOTTOM_LEFT); byte[] chatPacket = PacketBuilder.CreateChat(formattedmessage, PacketBuilder.CHAT_BOTTOM_LEFT);
user.LoggedinClient.SendPacket(chatPacket); user.LoggedinClient.SendPacket(chatPacket);