This commit is contained in:
@@ -18,10 +18,13 @@ func (h Controller) ItemSale(data *C2S_ITEM_SALE, c *player.Player) (result *fig
|
||||
return nil, errorcode.ErrorCodes.ErrSystemError
|
||||
}
|
||||
|
||||
if err := c.Service.Item.UPDATE(data.ItemId, -gconv.Int(data.Amount)); err != nil {
|
||||
return nil, errorcode.ErrorCodes.ErrInsufficientItems
|
||||
}
|
||||
|
||||
itemConfig := xmlres.ItemsMAP[int(data.ItemId)]
|
||||
if itemConfig.SellPrice != 0 {
|
||||
c.Info.Coins += int64(int64(data.Amount) * int64(itemConfig.SellPrice))
|
||||
}
|
||||
c.Service.Item.UPDATE(data.ItemId, -gconv.Int(data.Amount))
|
||||
return result, 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user