Skip to content

Commit

Permalink
change
Browse files Browse the repository at this point in the history
  • Loading branch information
xNatsuri committed Sep 9, 2024
1 parent fe3762b commit 7ffb673
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions server/player/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ func New(name string, skin skin.Skin, pos mgl64.Vec3) *Player {
p.enchantSeed.Store(rand.Int63())
p.scale.Store(math.Float64bits(1))
p.pos.Store(&pos)
now := time.Now()
p.lastXPPickup.Store(&now)
return p
}

Expand Down Expand Up @@ -2149,7 +2147,7 @@ func (p *Player) CollectExperience(value int) bool {
return false
}
last := p.lastXPPickup.Load()
if time.Since(*last) < time.Millisecond*100 {
if last != nil && time.Since(*last) < time.Millisecond*100 {
return false
}
value = p.mendItems(value)
Expand Down

0 comments on commit 7ffb673

Please sign in to comment.