完善多人世界队伍

This commit is contained in:
huangxiaolei
2022-12-10 19:48:35 +08:00
parent 50de81588b
commit edd8a98f92
17 changed files with 313 additions and 485 deletions

View File

@@ -89,7 +89,6 @@ func (g *GameManager) WearUserAvatarEquip(userId uint32, avatarId uint32, weapon
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
scene := world.GetSceneById(player.SceneId)
playerTeamEntity := scene.GetPlayerTeamEntity(player.PlayerID)
team := player.TeamConfig.GetActiveTeam()
if weapon.AvatarId != 0 {
// 武器在别的角色身上
@@ -105,10 +104,7 @@ func (g *GameManager) WearUserAvatarEquip(userId uint32, avatarId uint32, weapon
weakAvatar := player.AvatarMap[weakAvatarId]
weakWeapon := player.WeaponMap[weakAvatar.EquipWeapon.WeaponId]
for _, aid := range team.AvatarIdList {
if aid == 0 {
break
}
for _, aid := range world.GetPlayerAvatarIdList(player) {
if aid == weakAvatar.AvatarId {
playerTeamEntity.weaponEntityMap[weakWeapon.WeaponId] = scene.CreateEntityWeapon()
}
@@ -125,10 +121,7 @@ func (g *GameManager) WearUserAvatarEquip(userId uint32, avatarId uint32, weapon
player.WearWeapon(avatarId, weaponId)
}
for _, aid := range team.AvatarIdList {
if aid == 0 {
break
}
for _, aid := range world.GetPlayerAvatarIdList(player) {
if aid == avatarId {
playerTeamEntity.weaponEntityMap[weaponId] = scene.CreateEntityWeapon()
}