mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-12-27 22:10:35 +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:
@@ -246,8 +246,7 @@ static void handleWarp(CNSocket* sock, int32_t warpId) {
|
||||
Missions::failInstancedMissions(sock); // fail any instanced missions
|
||||
sock->sendPacket(resp, P_FE2CL_REP_PC_WARP_USE_NPC_SUCC);
|
||||
|
||||
Chunking::updateEntityChunk({sock}, plr->chunkPos, std::make_tuple(0, 0, 0)); // force player to reload chunks
|
||||
PlayerManager::updatePlayerPosition(sock, resp.iX, resp.iY, resp.iZ, INSTANCE_OVERWORLD, plr->angle);
|
||||
PlayerManager::updatePlayerPositionForWarp(sock, resp.iX, resp.iY, resp.iZ, INSTANCE_OVERWORLD);
|
||||
|
||||
// remove the player's ongoing race, if any
|
||||
if (Racing::EPRaces.find(sock) != Racing::EPRaces.end())
|
||||
|
||||
Reference in New Issue
Block a user