feat: 添加批量检查物品数量的方法并优化宠物融合逻辑
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
在物品服务中添加CheakItemM方法用于批量检查物品数量 修改宠物融合逻辑使用新方法进行物品检查
This commit is contained in:
@@ -47,12 +47,14 @@ func (h Controller) PetFusion(data *pet.C2S_PetFusion, c *player.Player) (result
|
||||
if Auxpetinfo.Nature == Mcatchpetinfo.Nature {
|
||||
natureId = int32(Auxpetinfo.Nature)
|
||||
}
|
||||
for _, v := range data.Item1 {
|
||||
if c.Service.Item.CheakItem(v) == 0 {
|
||||
|
||||
for _, v := range c.Service.Item.CheakItemM(data.Item1[:]...) {
|
||||
|
||||
if v.ItemCnt <= 0 {
|
||||
return result, errorcode.ErrorCodes.ErrInsufficientItems
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
resid := int(service.NewPetFusionService().Data(Mcatchpetinfo.ID, Auxpetinfo.ID, Mcatchpetinfo.Level+Auxpetinfo.Level))
|
||||
effect := int(service.NewPetFusionMaterialService().Data(data.Item1))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user