refactor(item): 统一物品操作接口并优化金币处理逻辑

This commit is contained in:
1
2025-12-16 06:54:27 +00:00
parent 39dc79f706
commit 49b4c8cf2a
10 changed files with 47 additions and 28 deletions

View File

@@ -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,