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)
return false;
if (args.Length >= 1)
if (args[0].ToUpper() != "HORSE")
return false;
if (args.Length <= 0)
return;
string formattedmessage = Messages.FormatPlayerCommandCompleteMessage(message);
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);
try
{
if (args[0].ToUpper() != "HORSE")
return false;
string formattedmessage = Messages.FormatPlayerCommandCompleteMessage(message);
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);
user.LoggedinClient.SendPacket(chatPacket);