mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 14:12:27 +08:00
调试
This commit is contained in:
@@ -556,8 +556,14 @@ func (g *GameManager) KillEntity(player *model.Player, scene *Scene, entityId ui
|
||||
g.SendToWorldA(scene.world, cmd.LifeStateChangeNotify, 0, ntf)
|
||||
g.RemoveSceneEntityNotifyBroadcast(scene, proto.VisionType_VISION_DIE, []uint32{entity.id})
|
||||
// 删除实体
|
||||
scene.DestroyEntity(entity.id)
|
||||
|
||||
group := scene.GetGroupById(entity.groupId)
|
||||
if group == nil {
|
||||
logger.Error("get scene group is nil, groupId: %v, uid: %v", entity.groupId, player.PlayerID)
|
||||
return
|
||||
}
|
||||
group.DestroyEntity(entity.GetId())
|
||||
scene.DestroyEntity(entity.GetId())
|
||||
// 怪物死亡触发器
|
||||
if entity.GetEntityType() == constant.ENTITY_TYPE_MONSTER {
|
||||
if entity.groupId == 133003095 {
|
||||
logger.Debug("==========1==========")
|
||||
@@ -567,11 +573,6 @@ func (g *GameManager) KillEntity(player *model.Player, scene *Scene, entityId ui
|
||||
logger.Error("get group config is nil, groupId: %v, uid: %v", entity.groupId, player.PlayerID)
|
||||
return
|
||||
}
|
||||
group := scene.GetGroupById(entity.groupId)
|
||||
if group == nil {
|
||||
logger.Error("get scene group is nil, groupId: %v, uid: %v", entity.groupId, player.PlayerID)
|
||||
return
|
||||
}
|
||||
for suiteId := range group.GetAllSuite() {
|
||||
if entity.groupId == 133003095 {
|
||||
logger.Debug("==========2==========")
|
||||
|
||||
@@ -519,6 +519,17 @@ func (g *Group) GetEntityByConfigId(configId uint32) *Entity {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (g *Group) DestroyEntity(entityId uint32) {
|
||||
for _, suite := range g.suiteMap {
|
||||
for _, entity := range suite.entityMap {
|
||||
if entity.id == entityId {
|
||||
delete(suite.entityMap, entity.id)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Suite) GetEntityById(entityId uint32) *Entity {
|
||||
return s.entityMap[entityId]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user