mirror of
https://github.com/CPunch/gopenfusion.git
synced 2024-11-21 15:00:07 +00:00
fix: add player to current chunk on LOAD_COMPLETE
This commit is contained in:
parent
2a6fb25f03
commit
335fdb417c
@ -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
|
// we send the chunk updates (PC_NEW, NPC_NEW, etc.) after the enter packet
|
||||||
chunkPos := entity.MakeChunkPosition(plr.X, plr.Y)
|
chunkPos := entity.MakeChunkPosition(plr.X, plr.Y)
|
||||||
viewableChunks := server.getViewableChunks(chunkPos)
|
viewableChunks := server.getViewableChunks(chunkPos)
|
||||||
|
|
||||||
plr.SetChunkPos(chunkPos)
|
plr.SetChunkPos(chunkPos)
|
||||||
|
server.getChunk(chunkPos).AddEntity(plr)
|
||||||
server.addEntityToChunks(plr, viewableChunks)
|
server.addEntityToChunks(plr, viewableChunks)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user