From d97444cca502f2536edc1930972a33b79f7ef366 Mon Sep 17 00:00:00 2001 From: dongresource Date: Mon, 28 Dec 2020 00:42:29 +0100 Subject: [PATCH] Remove each group member's vehicle when warping into an instance --- src/NPCManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/NPCManager.cpp b/src/NPCManager.cpp index 7d368f4..6165ff3 100644 --- a/src/NPCManager.cpp +++ b/src/NPCManager.cpp @@ -531,6 +531,9 @@ void NPCManager::handleWarp(CNSocket* sock, int32_t warpId) { if (Warps.find(warpId) == Warps.end()) return; + // remove the player's vehicle + plr->iPCState &= ~8; + // std::cerr << "Warped to Map Num:" << Warps[warpId].instanceID << " NPC ID " << Warps[warpId].npcID << std::endl; if (Warps[warpId].isInstance) { uint64_t instanceID = Warps[warpId].instanceID; @@ -565,6 +568,9 @@ void NPCManager::handleWarp(CNSocket* sock, int32_t warpId) { otherPlr->recallZ = Warps[warpId].z + RESURRECT_HEIGHT; otherPlr->recallInstance = instanceID; + // remove their vehicle if they're on one + otherPlr->iPCState &= ~8; + PlayerManager::sendPlayerTo(sockTo, Warps[warpId].x, Warps[warpId].y, Warps[warpId].z, instanceID); } }