Skip to content

Commit

Permalink
player/player.go: Fix more atomic nil pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
TwistedAsylumMC committed Sep 20, 2024
1 parent db26a06 commit adc474b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/player/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ func New(name string, skin skin.Skin, pos mgl64.Vec3) *Player {
mc: &entity.MovementComputer{Gravity: 0.08, Drag: 0.02, DragBeforeGravity: true},
}
var scoreTag string
var heldSlot uint32
var vel mgl64.Vec3
var gm world.GameMode = world.GameModeSurvival
p.gameMode.Store(&gm)
p.Handle(nil)
Expand All @@ -145,6 +147,8 @@ 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)
p.vel.Store(&vel)
p.heldSlot.Store(heldSlot)
return p
}

Expand Down

0 comments on commit adc474b

Please sign in to comment.