```
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

fix(fight_tower): 修复战斗塔Boss获取逻辑错误

- 修改条件判断从检查boss不为nil改为检查boss[0].BossIds长度不为0
- 修正PetTawor方法中索引越界问题,从boss[0]改为boss[1]
- 在TowerService.Boss方法中添加按tower_level升序排序确保数据一致性
```
This commit is contained in:
昔念
2026-02-26 01:02:30 +08:00
parent 0091e3a8dd
commit 6c61059cfe
2 changed files with 3 additions and 3 deletions

View File

@@ -81,7 +81,7 @@ func (h Controller) FreshChoiceFightLevel(data *fight.C2S_FRESH_CHOICE_FIGHT_LEV
//next := service.NewTower600Service().Boss(c.Info.CurrentFreshStage + 1)
}
if boss != nil {
if len(boss[0].BossIds) != 0 {
//单节点,取获取到的一个,然后因为不是剧情,所以只有一层
r := service.NewBossService().Get(boss[0].BossIds[0])
for _, v := range r {
@@ -131,7 +131,7 @@ func (h Controller) PetTawor(data *fight.StartTwarInboundInfo, c *player.Player)
}
if len(boss) > 1 {
r := service.NewBossService().Get(boss[0].BossIds[0])
r := service.NewBossService().Get(boss[1].BossIds[0])
for _, v := range r {
result.BossID = append(result.BossID, uint32(v.MonID))
}