fix(fight_tower): 修复战斗塔Boss获取逻辑错误 - 修改条件判断从检查boss不为nil改为检查boss[0].BossIds长度不为0 - 修正PetTawor方法中索引越界问题,从boss[0]改为boss[1] - 在TowerService.Boss方法中添加按tower_level升序排序确保数据一致性 ```
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ func (m *UnifiedTowerModel) GroupName() string {
|
||||
// Boss 根据塔等级获取对应的Boss配置(统一入口)
|
||||
func (s *TowerService) Boss(towerLevel ...uint32) []model.BaseTowerConfig {
|
||||
// 构建基础查询条件
|
||||
query := dbm_enable(s.Model).WhereIn("tower_level", towerLevel)
|
||||
query := dbm_enable(s.Model).WhereIn("tower_level", towerLevel).OrderAsc("tower_level")
|
||||
|
||||
// 600塔专属的缓存配置
|
||||
var config []model.BaseTowerConfig
|
||||
|
||||
Reference in New Issue
Block a user