Commit 0358e23248a52d1aa47bd4a6d2b99326628b70e5
1 parent
c8509ef6
fix: update notify equipment
Showing
2 changed files
with
8 additions
and
2 deletions
Show diff stats
cmd/gameserver/action/GmAction.go
... | ... | @@ -26,6 +26,12 @@ func (gm *GmAction) AddEquip(role *models.RoleModel, properties map[string]inter |
26 | 26 | } |
27 | 27 | //TODO 验证装备是否存在 |
28 | 28 | |
29 | - role.AddEquip(equip) | |
29 | + if role.GetConn() != nil { | |
30 | + role.GetConn().CustomChan() <- func() { | |
31 | + role.AddEquip(equip) | |
32 | + } | |
33 | + } else { | |
34 | + role.AddEquip(equip) | |
35 | + } | |
30 | 36 | return 0 |
31 | 37 | } | ... | ... |