Merge remote-tracking branch 'origin/main' into main
This commit is contained in:
commit
cbf9fdfa47
2 files changed
+15
-7
No files matched your search
@@ -96,11 +96,19 @@ func (s *Scene) CreateEntityAvatar(player *model.Player, avatarId uint32) uint32
|
||||
return 0
|
||||
}
|
||||
entity := &Entity{
|
||||
id: entityId,
|
||||
scene: s,
|
||||
lifeState: avatar.LifeState,
|
||||
pos: player.Pos, // 所有角色实体暂时公用玩家的位置信息
|
||||
rot: player.Rot,
|
||||
id: entityId,
|
||||
scene: s,
|
||||
lifeState: avatar.LifeState,
|
||||
pos: &model.Vector{
|
||||
X: player.Pos.X,
|
||||
Y: player.Pos.Y,
|
||||
Z: player.Pos.Z,
|
||||
}, // 所有角色实体暂时公用玩家的位置信息
|
||||
rot: &model.Vector{
|
||||
X: player.Rot.X,
|
||||
Y: player.Rot.Y,
|
||||
Z: player.Rot.Z,
|
||||
},
|
||||
moveState: uint16(proto.MotionState_MOTION_NONE),
|
||||
lastMoveSceneTimeMs: 0,
|
||||
lastMoveReliableSeq: 0,
|
||||
|
||||
@@ -272,6 +272,8 @@ func (g *Game) handleEntityMove(player *model.Player, world *World, scene *Scene
|
||||
} else {
|
||||
g.AiWorldAoiPlayerMove(player, world, scene, player.Pos, pos)
|
||||
}
|
||||
// 场景天气区域变更检测
|
||||
g.SceneWeatherAreaCheck(player, player.Pos, pos)
|
||||
// 更新玩家的位置信息
|
||||
player.Pos.X, player.Pos.Y, player.Pos.Z = pos.X, pos.Y, pos.Z
|
||||
player.Rot.X, player.Rot.Y, player.Rot.Z = rot.X, rot.Y, rot.Z
|
||||
@@ -410,8 +412,6 @@ func (g *Game) SceneBlockAoiPlayerMove(player *model.Player, world *World, scene
|
||||
}
|
||||
// 场景区域触发器检测
|
||||
g.SceneRegionTriggerCheck(player, oldPos, newPos, avatarEntityId)
|
||||
// 场景天气区域变更检测
|
||||
g.SceneWeatherAreaCheck(player, oldPos, newPos)
|
||||
}
|
||||
|
||||
func (g *Game) AiWorldAoiPlayerMove(player *model.Player, world *World, scene *Scene, oldPos *model.Vector, newPos *model.Vector) {
|
||||
|
||||
Reference in new issue
Block a user