diff --git a/logic/service/fight/action.go b/logic/service/fight/action.go index 388ee9df7..6b3e0b07d 100644 --- a/logic/service/fight/action.go +++ b/logic/service/fight/action.go @@ -370,7 +370,7 @@ func (f *FightC) collectFightPetInfos(inputs []*input.Input) []info.FightPetInfo Hp: currentPet.Info.Hp, MaxHp: currentPet.Info.MaxHp, Level: currentPet.Info.Level, - Catchable: uint32(fighter.CanCapture), + Catchable: fightPetCatchableFlag(fighter.CanCapture), } if fighter.AttackValue != nil { fightInfo.Prop = fighter.AttackValue.Prop @@ -380,6 +380,13 @@ func (f *FightC) collectFightPetInfos(inputs []*input.Input) []info.FightPetInfo return infos } +func fightPetCatchableFlag(catchRate int) uint32 { + if catchRate > 0 { + return 1 + } + return 0 +} + // checkBothPlayersReady 检查PVP战斗中双方是否都已准备完成 // 参数c为当前准备的玩家,返回true表示双方均准备完成 func (f *FightC) checkBothPlayersReady(currentPlayer common.PlayerI) bool {