Skip to content

Commit

Permalink
session/player.go: Fix go vet
Browse files Browse the repository at this point in the history
  • Loading branch information
TwistedAsylumMC committed Sep 1, 2024
1 parent bb57ceb commit 900b9f4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/player/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type Player struct {

inv, offHand, enderChest *inventory.Inventory
armour *inventory.Armour
heldSlot atomic.Uint32
heldSlot *atomic.Uint32

sneaking, sprinting, swimming, gliding, flying,
invisible, immobile, onGround, usingItem atomic.Bool
Expand Down
2 changes: 1 addition & 1 deletion server/session/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ func (s *Session) removeFromPlayerList(session *Session) {

// HandleInventories starts handling the inventories of the Controllable entity of the session. It sends packets when
// slots in the inventory are changed.
func (s *Session) HandleInventories() (inv, offHand, enderChest *inventory.Inventory, armour *inventory.Armour, heldSlot atomic.Uint32) {
func (s *Session) HandleInventories() (inv, offHand, enderChest *inventory.Inventory, armour *inventory.Armour, heldSlot *atomic.Uint32) {
s.inv = inventory.New(36, func(slot int, _, item item.Stack) {
if s.c == nil {
return
Expand Down
3 changes: 2 additions & 1 deletion server/session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type Session struct {
hiddenEntities map[world.Entity]struct{}

// heldSlot is the slot in the inventory that the controllable is holding.
heldSlot atomic.Uint32
heldSlot *atomic.Uint32
inv, offHand, enderChest, ui *inventory.Inventory
armour *inventory.Armour

Expand Down Expand Up @@ -162,6 +162,7 @@ func New(conn Conn, maxChunkRadius int, log Logger, joinMessage, quitMessage str
conn: conn,
log: log,
currentEntityRuntimeID: 1,
heldSlot: new(atomic.Uint32),
joinMessage: joinMessage,
quitMessage: quitMessage,
}
Expand Down

0 comments on commit 900b9f4

Please sign in to comment.