"refactor(map): 优化地图NPC刷新逻辑并调整怪物生成冷却时间"

This commit is contained in:
1
2025-12-17 09:52:44 +00:00
parent 09dad913fe
commit 0322f28f53
3 changed files with 5 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ package controller
import (
"blazing/common/socket/errorcode"
"sync/atomic"
"time"
"blazing/logic/service/fight"
"blazing/logic/service/maphot"
@@ -52,7 +53,7 @@ func (h *Controller) MapLeave(data *space.LeaveMapInboundInfo, c *player.Player)
}
func (h *Controller) MapList(data *space.ListMapPlayerInboundInfo, c *player.Player) (result *info.ListMapPlayerOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
atomic.StoreUint32(&c.Canmon, 2)
c.MapNPC.Reset(5 * time.Second)
result = &info.ListMapPlayerOutboundInfo{
Player: c.GetSpace().GetInfo(c),
}