Command changes and code cleanup

This commit is contained in:
KimLS
2017-07-21 20:22:33 -07:00
parent ab33148f81
commit bdc90ac3a7
12 changed files with 253 additions and 2482 deletions
-308
View File
@@ -59,7 +59,6 @@
#include "command.h"
#include "guild_mgr.h"
#include "map.h"
#include "pathing.h"
#include "qglobals.h"
#include "queryserv.h"
#include "quest_parser_collection.h"
@@ -6816,313 +6815,6 @@ void command_path(Client *c, const Seperator *sep)
if (zone->pathing) {
zone->pathing->DebugCommand(c, sep);
}
//if(sep->arg[1][0] == '\0' || !strcasecmp(sep->arg[1], "help"))
//{
// c->Message(0, "Syntax: #path shownodes: Spawns a npc to represent every npc node.");
// c->Message(0, "#path info node_id: Gives information about node info (requires shownode target).");
// c->Message(0, "#path dump file_name: Dumps the current zone->pathing to a file of your naming.");
// c->Message(0, "#path add [requested_id]: Adds a node at your current location will try to take the requested id if possible.");
// c->Message(0, "#path connect connect_to_id [is_teleport] [door_id]: Connects the currently targeted node to connect_to_id's node and connects that node back (requires shownode target).");
// c->Message(0, "#path sconnect connect_to_id [is_teleport] [door_id]: Connects the currently targeted node to connect_to_id's node (requires shownode target).");
// c->Message(0, "#path qconnect [set]: short cut connect, connects the targeted node to the node you set with #path qconnect set (requires shownode target).");
// c->Message(0, "#path disconnect [all]/disconnect_from_id: Disconnects the currently targeted node to disconnect from disconnect from id's node (requires shownode target), if passed all as the second argument it will disconnect this node from every other node.");
// c->Message(0, "#path move: Moves your targeted node to your current position");
// c->Message(0, "#path process file_name: processes the map file and tries to automatically generate a rudimentary path setup and then dumps the current zone->pathing to a file of your naming.");
// c->Message(0, "#path resort [nodes]: resorts the connections/nodes after you've manually altered them so they'll work.");
// return;
//}
//if(!strcasecmp(sep->arg[1], "shownodes"))
//{
// if(zone->pathing)
// zone->pathing->SpawnPathNodes();
//
// return;
//}
//
//if(!strcasecmp(sep->arg[1], "info"))
//{
// if(zone->pathing)
// {
// zone->pathing->NodeInfo(c);
// }
// return;
//}
//
//if(!strcasecmp(sep->arg[1], "dump"))
//{
// if(zone->pathing)
// {
// if(sep->arg[2][0] == '\0')
// return;
//
// zone->pathing->DumpPath(sep->arg[2]);
// }
// return;
//}
//
//if(!strcasecmp(sep->arg[1], "add"))
//{
// if(zone->pathing)
// {
// float px = c->GetX();
// float py = c->GetY();
// float pz = c->GetZ();
// float best_z;
//
// if(zone->zonemap)
// {
// glm::vec3 loc(px, py, pz);
// best_z = zone->zonemap->FindBestZ(loc, nullptr);
// }
// else
// {
// best_z = pz;
// }
// int32 res = zone->pathing->AddNode(px, py, pz, best_z, atoi(sep->arg[2]));
// if(res >= 0)
// {
// c->Message(0, "Added Path Node: %i", res);
// }
// else
// {
// c->Message(0, "Failed to add Path Node");
// }
// }
// else
// {
// zone->pathing = new PathManager();
// float px = c->GetX();
// float py = c->GetY();
// float pz = c->GetZ();
// float best_z;
//
// if(zone->zonemap)
// {
// glm::vec3 loc(px, py, pz);
// best_z = zone->zonemap->FindBestZ(loc, nullptr);
// }
// else
// {
// best_z = pz;
// }
// int32 res = zone->pathing->AddNode(px, py, pz, best_z, atoi(sep->arg[2]));
// if(res >= 0)
// {
// c->Message(0, "Added Path Node: %i", res);
// }
// else
// {
// c->Message(0, "Failed to add Path Node");
// }
// }
// return;
//}
//
//if(!strcasecmp(sep->arg[1], "remove"))
//{
// if(zone->pathing)
// {
// if(zone->pathing->DeleteNode(c))
// {
// c->Message(0, "Removed Node.");
// }
// else
// {
// c->Message(0, "Unable to Remove Node.");
// }
// }
// return;
//}
//
//if(!strcasecmp(sep->arg[1], "connect"))
//{
// if(zone->pathing)
// {
// zone->pathing->ConnectNodeToNode(c, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]));
// }
// return;
//}
//
//if(!strcasecmp(sep->arg[1], "sconnect"))
//{
// if(zone->pathing)
// {
// zone->pathing->ConnectNode(c, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]));
// }
// return;
//}
//
//if(!strcasecmp(sep->arg[1], "qconnect"))
//{
// if(zone->pathing)
// {
// if(!strcasecmp(sep->arg[2], "set"))
// {
// zone->pathing->QuickConnect(c, true);
// }
// else
// {
// zone->pathing->QuickConnect(c, false);
// }
// }
// return;
//}
//
//if(!strcasecmp(sep->arg[1], "disconnect"))
//{
// if(zone->pathing)
// {
// if(!strcasecmp(sep->arg[2], "all"))
// {
// zone->pathing->DisconnectAll(c);
// }
// else
// {
// zone->pathing->DisconnectNodeToNode(c, atoi(sep->arg[2]));
// }
// }
// return;
//}
//
//
//if(!strcasecmp(sep->arg[1], "move"))
//{
// if(zone->pathing)
// {
// zone->pathing->MoveNode(c);
// }
// return;
//}
//
//if(!strcasecmp(sep->arg[1], "process"))
//{
// if(zone->pathing)
// {
// if(sep->arg[2][0] == '\0')
// return;
//
// zone->pathing->ProcessNodesAndSave(sep->arg[2]);
// c->Message(0, "Path processed...");
// }
// return;
//}
//
//if(!strcasecmp(sep->arg[1], "resort"))
//{
// if(zone->pathing)
// {
// if(!strcasecmp(sep->arg[2], "nodes"))
// {
// zone->pathing->SortNodes();
// c->Message(0, "Nodes resorted...");
// }
// else
// {
// zone->pathing->ResortConnections();
// c->Message(0, "Connections resorted...");
// }
// }
// return;
//}
//
//if(!strcasecmp(sep->arg[1], "hazard"))
//{
// if(zone->pathing)
// {
// if(c && c->GetTarget())
// {
// if (zone->pathing->NoHazardsAccurate(glm::vec3(c->GetX(), c->GetY(), c->GetZ()),
// glm::vec3(c->GetTarget()->GetX(), c->GetTarget()->GetY(), c->GetTarget()->GetZ())))
// {
// c->Message(0, "No hazards.");
// }
// else
// {
// c->Message(0, "Hazard Detected...");
// }
// }
// }
// return;
//}
//
//if(!strcasecmp(sep->arg[1], "print"))
//{
// if(zone->pathing)
// {
// zone->pathing->PrintPathing();
// }
// return;
//}
//
//if(!strcasecmp(sep->arg[1], "showneighbours") || !strcasecmp(sep->arg[1], "showneighbors"))
//{
// if(!c->GetTarget())
// {
// c->Message(0, "First #path shownodes to spawn the pathnodes, and then target one of them.");
// return;
// }
// if(zone->pathing)
// {
// zone->pathing->ShowPathNodeNeighbours(c);
// return;
// }
//}
//if(!strcasecmp(sep->arg[1], "meshtest"))
//{
// if(zone->pathing)
// {
// if(!strcasecmp(sep->arg[2], "simple"))
// {
// c->Message(0, "You may go linkdead. Results will be in the log file.");
// zone->pathing->SimpleMeshTest();
// return;
// }
// else
// {
// c->Message(0, "You may go linkdead. Results will be in the log file.");
// zone->pathing->MeshTest();
// return;
// }
// }
//}
//
//if(!strcasecmp(sep->arg[1], "allspawns"))
//{
// if(zone->pathing)
// {
// c->Message(0, "You may go linkdead. Results will be in the log file.");
// entity_list.FindPathsToAllNPCs();
// return;
// }
//}
//
//if(!strcasecmp(sep->arg[1], "nearest"))
//{
// if(!c->GetTarget() || !c->GetTarget()->IsMob())
// {
// c->Message(0, "You must target something.");
// return;
// }
//
// if(zone->pathing)
// {
// Mob *m = c->GetTarget();
//
// glm::vec3 Position(m->GetX(), m->GetY(), m->GetZ());
//
// int Node = zone->pathing->FindNearestPathNode(Position);
//
// if(Node == -1)
// c->Message(0, "Unable to locate a path node within range.");
// else
// c->Message(0, "Nearest path node is %i", Node);
//
// return;
// }
//}
//
//c->Message(0, "Unknown path command.");
}
void Client::Undye() {