Possibly fixed all chunking desyncs

* Players/NPCs that initialize chunks now correctly pull their main chunk into their viewdata.
* Tested on the public server, seems to have solved the chunking issues.
This commit is contained in:
2020-10-23 19:47:30 +01:00
parent 3b5af415fb
commit cc06fdcf60
3 changed files with 30 additions and 6 deletions

View File

@@ -222,9 +222,9 @@ void PlayerManager::updatePlayerChunk(CNSocket* sock, int X, int Y, uint64_t ins
// now, add all the new npcs & players!
addPlayerToChunks(ChunkManager::getDeltaChunks(allChunks, view.currentChunks), sock);
ChunkManager::addPlayer(X, Y, view.plr->instanceID, sock); // takes care of adding the player to the chunk if it exists or not
view.chunkPos = newPos;
view.currentChunks = allChunks;
ChunkManager::addPlayer(X, Y, view.plr->instanceID, sock); // takes care of adding the player to the chunk if it exists or not
}
void PlayerManager::sendPlayerTo(CNSocket* sock, int X, int Y, int Z, uint64_t I) {