fix: add player to current chunk on LOAD_COMPLETE

This commit is contained in:
CPunch 2023-12-05 19:17:58 -06:00
parent 2a6fb25f03
commit 335fdb417c

View File

@ -85,7 +85,9 @@ func (server *ShardServer) LoadingComplete(peer *cnet.Peer, pkt protocol.Packet)
// we send the chunk updates (PC_NEW, NPC_NEW, etc.) after the enter packet
chunkPos := entity.MakeChunkPosition(plr.X, plr.Y)
viewableChunks := server.getViewableChunks(chunkPos)
plr.SetChunkPos(chunkPos)
server.getChunk(chunkPos).AddEntity(plr)
server.addEntityToChunks(plr, viewableChunks)
return nil
}