fix: 修正使用道具时的物品ID计算错误
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-08 16:48:06 +08:00
committed by cnb
parent 069d961585
commit a56f19bd4c

View File

@@ -98,7 +98,8 @@ func (h Controller) handlexuancaiItem(currentPet *model.PetInfo, c *player.Playe
if r.Secondary != nil {
return errorcode.ErrorCodes.ErrItemUnusable
}
items := c.Service.Item.CheakItem(uint32(xmlres.PetMAP[int(currentPet.ID)].Type) + 400686)
itemid := uint32(currentPet.Type()) + 400686
items := c.Service.Item.CheakItem(itemid)
if items < 100 {
return errorcode.ErrorCodes.ErrInsufficientItems
}
@@ -108,7 +109,7 @@ func (h Controller) handlexuancaiItem(currentPet *model.PetInfo, c *player.Playe
return errorcode.ErrorCodes.ErrItemUnusable
}
c.Service.Item.UPDATE(uint32(items), -100)
c.Service.Item.UPDATE(itemid, -100)
return 0
}