mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-12-22 03:50:04 +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:
@@ -165,9 +165,9 @@ static void transportWarpHandler(CNSocket* sock, CNPacketData* data) {
|
||||
|
||||
if (target == nullptr)
|
||||
return;
|
||||
|
||||
// we warped; update position and chunks
|
||||
Chunking::updateEntityChunk({sock}, plr->chunkPos, std::make_tuple(0, 0, 0)); // force player to reload chunks
|
||||
PlayerManager::updatePlayerPosition(sock, target->x, target->y, target->z, INSTANCE_OVERWORLD, plr->angle);
|
||||
PlayerManager::updatePlayerPositionForWarp(sock, target->x, target->y, target->z, INSTANCE_OVERWORLD);
|
||||
}
|
||||
|
||||
void Transport::testMssRoute(CNSocket *sock, std::vector<Vec3>* route) {
|
||||
|
||||
Reference in New Issue
Block a user