refactor: 简化战斗宠物列表处理逻辑
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-24 01:38:02 +08:00
committed by cnb
parent 707142bd49
commit 0aba7e7ccb
4 changed files with 11 additions and 17 deletions

View File

@@ -54,13 +54,8 @@ func (h Controller) OnPlayerHandleFightInvite(data *fight.HandleFightInviteInbou
atomic.StoreUint32(&c.Fightinfo.Mode, 0)
return
}
var u1, u2 []model.PetInfo
if data.Mode == info.BattleMode.SINGLE_MODE {
u1, u2 = v.GetInfo().PetList[:1], c.GetInfo().PetList[:1]
} else {
u1, u2 = v.GetInfo().PetList, c.GetInfo().PetList
}
_, err = fight.NewFight(v, c, u1, u2, func(foi model.FightOverInfo) {
_, err = fight.NewFight(v, c, v.GetInfo().PetList, c.GetInfo().PetList, func(foi model.FightOverInfo) {
//println("好友对战测试", foi.Reason)