mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-01-24 07:20:49 +00:00
Use a specialized null value for ChunkPos
This prevents logic errors related to being in chunk 0 0 0. Also: * Moved some duplicated chunk teleportation logic to a new helper function * Made ChunkPos into a proper class so it can default to INVALID_CHUNK when default-initialized * Reversed the inclusion order of Chunking.hpp and Entities.hpp to work around problems with type definitions
This commit is contained in:
@@ -378,12 +378,9 @@ static void npcRotateCommand(std::string full, std::vector<std::string>& args, C
|
||||
}
|
||||
|
||||
static void refreshCommand(std::string full, std::vector<std::string>& args, CNSocket* sock) {
|
||||
EntityRef ref = {sock};
|
||||
Entity* plr = ref.getEntity();
|
||||
ChunkPos currentChunk = plr->chunkPos;
|
||||
ChunkPos nullChunk = std::make_tuple(0, 0, 0);
|
||||
Chunking::updateEntityChunk(ref, currentChunk, nullChunk);
|
||||
Chunking::updateEntityChunk(ref, nullChunk, currentChunk);
|
||||
Player *plr = PlayerManager::getPlayer(sock);
|
||||
|
||||
PlayerManager::updatePlayerPositionForWarp(sock, plr->x, plr->y, plr->z, plr->instanceID);
|
||||
}
|
||||
|
||||
static void instanceCommand(std::string full, std::vector<std::string>& args, CNSocket* sock) {
|
||||
|
||||
Reference in New Issue
Block a user