This commit is contained in:
@@ -39,9 +39,7 @@ func (p *Player) AddPetExp(petInfo *model.PetInfo, addExp int64) {
|
||||
p.Info.ExpPool -= addExp //减去已使用的经验
|
||||
gainedExp := exp //已获得的经验
|
||||
for exp >= int64(petInfo.NextLvExp) {
|
||||
|
||||
petInfo.Level++
|
||||
|
||||
exp -= int64(petInfo.LvExp)
|
||||
petInfo.Update(true)
|
||||
}
|
||||
|
||||
@@ -419,7 +419,15 @@ func (p *Player) ItemAdd(ItemId, ItemCnt int64) (result bool) {
|
||||
p.SendPack(t1.Pack(nil)) //准备包由各自发,因为协议不一样
|
||||
return false
|
||||
}
|
||||
p.Service.Item.UPDATE(uint32(ItemId), gconv.Int(ItemCnt))
|
||||
if err := p.Service.Item.UPDATE(uint32(ItemId), gconv.Int(ItemCnt)); err != nil {
|
||||
cool.Logger.Error(context.TODO(), "item add update failed", p.Info.UserID, ItemId, ItemCnt, err)
|
||||
|
||||
t1 := common.NewTomeeHeader(2601, p.Info.UserID)
|
||||
t1.Result = uint32(errorcode.ErrorCodes.ErrSystemError200007)
|
||||
|
||||
p.SendPack(t1.Pack(nil)) //准备包由各自发,因为协议不一样
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user