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

@@ -27,6 +27,7 @@ namespace ChunkManager {
extern std::map<std::tuple<int, int, uint64_t>, Chunk*> chunks;
void newChunk(std::tuple<int, int, uint64_t> pos);
void populateNewChunk(Chunk* chunk, std::tuple<int, int, uint64_t> pos);
void addNPC(int posX, int posY, uint64_t instanceID, int32_t id);
void addPlayer(int posX, int posY, uint64_t instanceID, CNSocket* sock);
bool removePlayer(std::tuple<int, int, uint64_t> chunkPos, CNSocket* sock);