From 0ccc66208d5ef5e930eb2578a4ef173f388bc518 Mon Sep 17 00:00:00 2001 From: gsemaj Date: Wed, 5 May 2021 15:24:40 -0400 Subject: [PATCH] Added /path here --- src/CustomCommands.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/CustomCommands.cpp b/src/CustomCommands.cpp index 888c0c7..861dc48 100644 --- a/src/CustomCommands.cpp +++ b/src/CustomCommands.cpp @@ -947,7 +947,7 @@ static void pathCommand(std::string full, std::vector& args, CNSock if (args.size() < 2) { Chat::sendServerMessage(sock, "[PATH] Too few arguments"); - Chat::sendServerMessage(sock, "[PATH] Usage: /path "); + Chat::sendServerMessage(sock, "[PATH] Usage: /path "); goto update; } @@ -956,7 +956,7 @@ static void pathCommand(std::string full, std::vector& args, CNSock // make sure the player doesn't have a follower if (TableData::RunningNPCPaths.find(plr->iID) != TableData::RunningNPCPaths.end()) { Chat::sendServerMessage(sock, "[PATH] An NPC is already following you"); - Chat::sendServerMessage(sock, "[PATH] Run '/path end ' first, if you're done"); + Chat::sendServerMessage(sock, "[PATH] Run '/path end' first, if you're done"); goto update; } @@ -994,6 +994,17 @@ static void pathCommand(std::string full, std::vector& args, CNSock goto update; } + // /path here + if (args[1] == "here") { + // bring the NPC to where the player is standing + Transport::NPCQueues.erase(npc->appearanceData.iNPC_ID); // delete transport queue + NPCManager::updateNPCPosition(npc->appearanceData.iNPC_ID, plr->x, plr->y, plr->z, npc->instanceID, 0); + npc->disappearFromViewOf(sock); + npc->enterIntoViewOf(sock); + Chat::sendServerMessage(sock, "[PATH] Come here"); + goto update; + } + // /path undo if (args[1] == "undo") { if (entry->second.size() == 1) {