refactor(item): 统一物品操作接口并优化金币处理逻辑
This commit is contained in:
@@ -64,7 +64,7 @@ func (h Controller) BuyGoldItem(data *item.C2S_GOLD_BUY_PRODUCT, c *player.Playe
|
||||
|
||||
isbuycot := c.ItemAdd(uint32(gconv.Uint32(r.ItemID)), uint32(data.Count))
|
||||
if isbuycot {
|
||||
c.User.SetGold(c.Info.UserID, c.User.GetGold(uint(c.Info.UserID))-usegold)
|
||||
c.User.UpdateGold(c.Info.UserID, -gconv.Float64(usegold))
|
||||
result = &item.S2C_GoldBuyProductInfo{
|
||||
Gold: c.User.GetGold(uint(c.Info.UserID)),
|
||||
PayGold: usegold,
|
||||
|
||||
Reference in New Issue
Block a user