refactor: 优化地图节点数据获取逻辑
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
将获取地图Boss信息的过滤逻辑从循环中移至GetDataB方法
This commit is contained in:
@@ -104,21 +104,19 @@ func GetSpace(id uint32) *Space {
|
||||
// ret.CanWeather = 1
|
||||
cool.Cron.CustomFunc(ret, ret.GenWer)
|
||||
}
|
||||
for _, v := range service.NewMapNodeService().GetData(ret.ID) {
|
||||
|
||||
if v.IsBroadcast != 0 { //说明是地图怪
|
||||
info := info.MapBossInfo{
|
||||
Id: v.TriggerID,
|
||||
Region: v.NodeID, //这个是注册的index
|
||||
Hp: v.HP,
|
||||
PosInfo: ParseCoordinateString(v.Pos),
|
||||
MaxHP: int(v.HP),
|
||||
Wer: v.Weather,
|
||||
}
|
||||
|
||||
ret.MapBossSInfo.INFO = append(ret.MapBossSInfo.INFO, info)
|
||||
for _, v := range service.NewMapNodeService().GetDataB(ret.ID) {
|
||||
|
||||
info := info.MapBossInfo{
|
||||
Id: v.TriggerID,
|
||||
Region: v.NodeID, //这个是注册的index
|
||||
Hp: v.HP,
|
||||
PosInfo: ParseCoordinateString(v.Pos),
|
||||
MaxHP: int(v.HP),
|
||||
Wer: v.Weather,
|
||||
}
|
||||
|
||||
ret.MapBossSInfo.INFO = append(ret.MapBossSInfo.INFO, info)
|
||||
|
||||
}
|
||||
|
||||
if len(ret.MapBossSInfo.INFO) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user