From 82b505a737606682cde11c5f96f24db8740384eb Mon Sep 17 00:00:00 2001 From: Gent S Date: Wed, 18 Nov 2020 21:41:16 -0500 Subject: [PATCH] Fix buddy warp causing softlock --- src/PlayerManager.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PlayerManager.cpp b/src/PlayerManager.cpp index ba9745f..4a926e1 100644 --- a/src/PlayerManager.cpp +++ b/src/PlayerManager.cpp @@ -134,11 +134,6 @@ void PlayerManager::sendPlayerTo(CNSocket* sock, int X, int Y, int Z, uint64_t I pkt.iEP_ID = PLAYERID(I) == 0; // iEP_ID has to be positive for the map to be enabled pkt.iInstanceMapNum = (int32_t)MAPNUM(I); // lower 32 bits are mapnum sock->sendPacket((void*)&pkt, P_FE2CL_INSTANCE_MAP_INFO, sizeof(sP_FE2CL_INSTANCE_MAP_INFO)); - INITSTRUCT(sP_FE2CL_REP_PC_GOTO_SUCC, pkt2); - pkt2.iX = X; - pkt2.iY = Y; - pkt2.iZ = Z; - sock->sendPacket((void*)&pkt2, P_FE2CL_REP_PC_GOTO_SUCC, sizeof(sP_FE2CL_REP_PC_GOTO_SUCC)); } else { // annoying but necessary to set the flag back INITSTRUCT(sP_FE2CL_REP_PC_WARP_USE_NPC_SUCC, resp); @@ -150,6 +145,11 @@ void PlayerManager::sendPlayerTo(CNSocket* sock, int X, int Y, int Z, uint64_t I sock->sendPacket((void*)&resp, P_FE2CL_REP_PC_WARP_USE_NPC_SUCC, sizeof(sP_FE2CL_REP_PC_WARP_USE_NPC_SUCC)); } + INITSTRUCT(sP_FE2CL_REP_PC_GOTO_SUCC, pkt2); + pkt2.iX = X; + pkt2.iY = Y; + pkt2.iZ = Z; + sock->sendPacket((void*)&pkt2, P_FE2CL_REP_PC_GOTO_SUCC, sizeof(sP_FE2CL_REP_PC_GOTO_SUCC)); updatePlayerPosition(sock, X, Y, Z, I, plr->angle); // post-warp: check if the source instance has no more players in it and delete it if so