Skip to content

Commit

Permalink
player/player.go: Don't send effects before the session knows its own…
Browse files Browse the repository at this point in the history
… entity handle.
  • Loading branch information
Sandertv committed Nov 23, 2024
1 parent 9237140 commit e34d434
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion server/player/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -2837,7 +2837,7 @@ func (p *Player) load(data Data) {

p.gameMode = data.GameMode
for _, potion := range data.Effects {
p.AddEffect(potion)
p.effects.Add(potion, p)
}
p.fireTicks = data.FireTicks
p.fallDistance = data.FallDistance
Expand Down
1 change: 1 addition & 0 deletions server/session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ func (s *Session) Spawn(c Controllable, tx *world.Tx) {
for _, e := range c.Effects() {
s.SendEffect(e)
}
s.ViewEntityState(c)

s.sendInv(s.inv, protocol.WindowIDInventory)
s.sendInv(s.ui, protocol.WindowIDUI)
Expand Down

0 comments on commit e34d434

Please sign in to comment.