mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-06 21:25:42 +12:00
Fix Auto-Sell
This commit is contained in:
parent
76abadcfa0
commit
fbc66cbfd2
1 changed files with 7 additions and 2 deletions
|
@ -3022,10 +3022,14 @@ namespace HISP.Server
|
|||
break;
|
||||
}
|
||||
|
||||
if(IsUserOnline(horseToSell.Owner))
|
||||
sender.LoggedinUser.TakeMoney(horseToSell.AutoSell);
|
||||
|
||||
if (IsUserOnline(horseToSell.Owner))
|
||||
{
|
||||
User seller = GetUserById(horseToSell.Owner);
|
||||
sender.LoggedinUser.HorseInventory.DeleteHorse(horseToSell, false);
|
||||
seller.HorseInventory.DeleteHorse(horseToSell, false);
|
||||
|
||||
seller.AddMoney(horseToSell.AutoSell);
|
||||
|
||||
byte[] horseBrought = PacketBuilder.CreateChat(Messages.FormatAutoSellSold(horseToSell.Name, horseToSell.AutoSell, sender.LoggedinUser.Username), PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
seller.LoggedinClient.SendPacket(horseBrought);
|
||||
|
@ -3033,6 +3037,7 @@ namespace HISP.Server
|
|||
else
|
||||
{
|
||||
Database.AddMessageToQueue(horseToSell.Owner, Messages.FormatAutoSellSoldOffline(horseToSell.Name, horseToSell.AutoSell, sender.LoggedinUser.Username));
|
||||
Database.SetPlayerMoney((Database.GetPlayerMoney(horseToSell.Owner) + horseToSell.AutoSell), horseToSell.Owner);
|
||||
}
|
||||
|
||||
horseToSell.Owner = sender.LoggedinUser.Id;
|
||||
|
|
Loading…
Add table
Reference in a new issue