Added /path here

This commit is contained in:
gsemaj 2021-05-05 15:24:40 -04:00 committed by Gent Semaj
parent ebd3b7b75a
commit 0ccc66208d
1 changed files with 13 additions and 2 deletions

View File

@ -947,7 +947,7 @@ static void pathCommand(std::string full, std::vector<std::string>& args, CNSock
if (args.size() < 2) {
Chat::sendServerMessage(sock, "[PATH] Too few arguments");
Chat::sendServerMessage(sock, "[PATH] Usage: /path <start/kf/undo/test/cancel/end>");
Chat::sendServerMessage(sock, "[PATH] Usage: /path <start/kf/undo/here/test/cancel/end>");
goto update;
}
@ -956,7 +956,7 @@ static void pathCommand(std::string full, std::vector<std::string>& 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 <endType>' 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<std::string>& 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) {