fix(map): 修复玩家离开地图时 Canmon 状态重置问题
修复了在玩家调用 MapList 接口时错误地将 Canmon 设置为 0 的逻辑 问题导致玩家状态异常,现已修正为正确的行为 --- fix(fight): 修复战斗中宠物死亡判断逻辑 在 NewSeIdx_9 战斗脚本中增加对当前宠物血量是否为 0 的检查 避免在宠物已死亡的情况下继续执行后续战斗逻辑,防止异常行为 --- refactor(pet): 优化宠物技能效果添加逻辑 移除冗余的 Effect 查找过程,简化为通过 HaveAN 判断是否存在技能
This commit is contained in:
@@ -51,7 +51,7 @@ func (h *Controller) MapLeave(data *maps.LeaveMapInboundInfo, c *player.Player)
|
||||
}
|
||||
func (h *Controller) MapList(data *maps.ListMapPlayerInboundInfo, c *player.Player) (result *info.ListMapPlayerOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
|
||||
atomic.StoreUint32(&c.Canmon, 2)
|
||||
atomic.StoreUint32(&c.Canmon, 0)
|
||||
|
||||
if atomic.LoadUint32(&c.GetSpace().TimeBoss.Flag) == 1 {
|
||||
defer c.SendPackCmd(2022, &c.GetSpace().TimeBoss)
|
||||
}
|
||||
|
||||
@@ -14,6 +14,11 @@ func (e *NewSel9) Action_end_ex() bool {
|
||||
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Our.CurrentPet.GetHP().IntPart() == 0 {
|
||||
|
||||
return true
|
||||
|
||||
}
|
||||
|
||||
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Args()[0]) == -1 {
|
||||
|
||||
|
||||
@@ -223,13 +223,12 @@ func (pet *PetInfo) RnadAN() {
|
||||
EID: uint16(gconv.Int16(v.Eid)),
|
||||
Args: v.ArgsS,
|
||||
}
|
||||
_, eff1, ok := utils.FindWithIndex(pet.EffectInfo, func(item PetEffectInfo) bool {
|
||||
return gconv.Int(xmlres.EffectMAP[int(item.Idx)].Stat) == 1
|
||||
})
|
||||
if ok {
|
||||
copier.Copy(eff1, ret)
|
||||
|
||||
if pet.HaveAN() {
|
||||
copier.Copy(pet.EffectInfo[0], ret)
|
||||
} else {
|
||||
pet.EffectInfo = append(pet.EffectInfo, *ret)
|
||||
}
|
||||
pet.EffectInfo = append(pet.EffectInfo, *ret)
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user