mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-07 13:45:42 +12:00
Fix crashing when selling item worth too much
This commit is contained in:
parent
0c89845552
commit
4293657614
1 changed files with 2 additions and 2 deletions
|
@ -6909,11 +6909,11 @@ namespace HISP.Server
|
||||||
Shop shop = sender.LoggedinUser.LastShoppedAt;
|
Shop shop = sender.LoggedinUser.LastShoppedAt;
|
||||||
if (shop != null)
|
if (shop != null)
|
||||||
{
|
{
|
||||||
UInt64 sellPrice = Convert.ToUInt32(shop.CalculateSellCost(itemInfo) * Convert.ToUInt32(totalSold));
|
UInt64 sellPrice = Convert.ToUInt64(shop.CalculateSellCost(itemInfo) * Convert.ToUInt64(totalSold));
|
||||||
if (shop.CanSell(itemInfo))
|
if (shop.CanSell(itemInfo))
|
||||||
{
|
{
|
||||||
// Check if goes over 2.1b
|
// Check if goes over 2.1b
|
||||||
if (Convert.ToUInt32(sender.LoggedinUser.Money) + sellPrice > 2100000000)
|
if (Convert.ToUInt64(sender.LoggedinUser.Money) + sellPrice > 2100000000)
|
||||||
{
|
{
|
||||||
byte[] cantSellMoneyCapCheck = PacketBuilder.CreateChat(Messages.CannotSellYoudGetTooMuchMoney, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
byte[] cantSellMoneyCapCheck = PacketBuilder.CreateChat(Messages.CannotSellYoudGetTooMuchMoney, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||||
sender.SendPacket(cantSellMoneyCapCheck);
|
sender.SendPacket(cantSellMoneyCapCheck);
|
||||||
|
|
Loading…
Add table
Reference in a new issue