refactor: 修复代码格式并调整地图玩家信息获取逻辑
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed

This commit is contained in:
xinian
2026-02-13 06:13:56 +08:00
committed by cnb
parent e47ada7e58
commit 58157e2d1c
2 changed files with 2 additions and 6 deletions

View File

@@ -19,7 +19,7 @@ func (h Controller) EnterMap(data *space.InInfo, c *player.Player) (result *info
if c.Info.MapID != data.MapId {
atomic.StoreUint32(&c.Canmon, 2)
c.MapNPC.Reset(7 * time.Second)
}else{
} else {
atomic.StoreUint32(&c.Canmon, 1)
}
c.Info.MapID = data.MapId //登录地图
@@ -47,10 +47,6 @@ func (h Controller) GetMapHot(data *maphot.InInfo, c *player.Player) (result *ma
func (h Controller) LeaveMap(data *space.LeaveMapInboundInfo, c *player.Player) (result *info.LeaveMapOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
atomic.StoreUint32(&c.Canmon, 0)
//data.Broadcast(c.Info.MapID, info.LeaveMapOutboundInfo{UserID: c.Info.UserID}) //同步广播
result = &info.LeaveMapOutboundInfo{
UserID: c.Info.UserID,
}
c.GetSpace().LeaveMap(c) //玩家离开地图
// 如果有正在运行的刷怪协程,发送停止信号