mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-06 21:25:42 +12:00
Fix horse dismount not closing swfmodule
This commit is contained in:
parent
9f26f1bd59
commit
a5bab68b03
2 changed files with 8 additions and 32 deletions
|
@ -8012,11 +8012,11 @@ namespace HISP.Server
|
|||
sender.LoggedinUser.Facing += incBy;
|
||||
sender.LoggedinUser.LastRiddenHorse = horseRandomId;
|
||||
|
||||
|
||||
byte[] rideHorsePacket = PacketBuilder.CreateHorseRidePacket(sender.LoggedinUser.X, sender.LoggedinUser.Y, sender.LoggedinUser.CharacterId, sender.LoggedinUser.Facing, 10, true);
|
||||
sender.SendPacket(rideHorsePacket);
|
||||
|
||||
UpdateUserFacingAndLocation(sender.LoggedinUser);
|
||||
|
||||
byte[] updatePlayer = PacketBuilder.CreateMovementPacket(sender.LoggedinUser.X, sender.LoggedinUser.Y, sender.LoggedinUser.CharacterId, sender.LoggedinUser.Facing, PacketBuilder.DIRECTION_NONE, true);
|
||||
sender.SendPacket(updatePlayer);
|
||||
|
||||
if (sender.LoggedinUser.HorseWindowOpen)
|
||||
UpdateArea(sender);
|
||||
}
|
||||
|
@ -8025,10 +8025,11 @@ namespace HISP.Server
|
|||
sender.LoggedinUser.CurrentlyRidingHorse = null;
|
||||
|
||||
sender.LoggedinUser.Facing %= 5;
|
||||
byte[] rideHorsePacket = PacketBuilder.CreateHorseRidePacket(sender.LoggedinUser.X, sender.LoggedinUser.Y, sender.LoggedinUser.CharacterId, sender.LoggedinUser.Facing, 10, true);
|
||||
sender.SendPacket(rideHorsePacket);
|
||||
|
||||
UpdateUserFacingAndLocation(sender.LoggedinUser);
|
||||
|
||||
byte[] updatePlayer = PacketBuilder.CreateMovementPacket(sender.LoggedinUser.X, sender.LoggedinUser.Y, sender.LoggedinUser.CharacterId, sender.LoggedinUser.Facing, PacketBuilder.DIRECTION_NONE, true);
|
||||
sender.SendPacket(updatePlayer);
|
||||
|
||||
if (sender.LoggedinUser.HorseWindowOpen)
|
||||
UpdateArea(sender);
|
||||
}
|
||||
|
|
|
@ -476,31 +476,6 @@ namespace HISP.Server
|
|||
return packet;
|
||||
}
|
||||
|
||||
public static byte[] CreateHorseRidePacket(int x, int y, int charId, int facing, int direction, bool walk)
|
||||
{
|
||||
// Header information
|
||||
byte[] packet = new byte[(1 * 10)];
|
||||
packet[0] = PACKET_MOVE;
|
||||
|
||||
packet[1] = (byte)(((x - 4) / 64) + 20);
|
||||
packet[2] = (byte)(((x - 4) % 64) + 20);
|
||||
|
||||
packet[3] = (byte)(((y - 1) / 64) + 20);
|
||||
packet[4] = (byte)(((y - 1) % 64) + 20);
|
||||
|
||||
packet[5] = (byte)(facing + 20);
|
||||
|
||||
packet[6] = (byte)((charId / 64) + 20);
|
||||
packet[7] = (byte)((charId % 64) + 20);
|
||||
|
||||
packet[8] = (byte)(direction + 20);
|
||||
|
||||
packet[9] = (byte)(Convert.ToInt32(walk) + 20);
|
||||
packet[packet.Length-1] = PACKET_TERMINATOR;
|
||||
|
||||
return packet;
|
||||
}
|
||||
|
||||
public static byte[] CreateMovementPacket(int x, int y, int charId, int facing, int direction, bool walk)
|
||||
{
|
||||
// Header information
|
||||
|
|
Loading…
Add table
Reference in a new issue