mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Add pathfinding interfaces, still heavily wip
This commit is contained in:
+68
-65
@@ -673,76 +673,79 @@ void QuestManager::repopzone() {
|
||||
}
|
||||
|
||||
void QuestManager::ConnectNodeToNode(int node1, int node2, int teleport, int doorid) {
|
||||
if (!node1 || !node2)
|
||||
{
|
||||
Log(Logs::General, Logs::Quests, "QuestManager::ConnectNodeToNode called without node1 or node2. Probably syntax error in quest file.");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!teleport)
|
||||
{
|
||||
teleport = 0;
|
||||
}
|
||||
else if (teleport == 1 || teleport == -1)
|
||||
{
|
||||
teleport = -1;
|
||||
}
|
||||
|
||||
if (!doorid)
|
||||
{
|
||||
doorid = 0;
|
||||
}
|
||||
|
||||
if (!zone->pathing)
|
||||
{
|
||||
// if no pathing bits available, make them available.
|
||||
zone->pathing = new PathManager();
|
||||
}
|
||||
|
||||
if (zone->pathing)
|
||||
{
|
||||
zone->pathing->ConnectNodeToNode(node1, node2, teleport, doorid);
|
||||
Log(Logs::Moderate, Logs::Quests, "QuestManager::ConnectNodeToNode connecting node %i to node %i.", node1, node2);
|
||||
}
|
||||
}
|
||||
//PATHING TODO
|
||||
//if (!node1 || !node2)
|
||||
//{
|
||||
// Log(Logs::General, Logs::Quests, "QuestManager::ConnectNodeToNode called without node1 or node2. Probably syntax error in quest file.");
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// if (!teleport)
|
||||
// {
|
||||
// teleport = 0;
|
||||
// }
|
||||
// else if (teleport == 1 || teleport == -1)
|
||||
// {
|
||||
// teleport = -1;
|
||||
// }
|
||||
//
|
||||
// if (!doorid)
|
||||
// {
|
||||
// doorid = 0;
|
||||
// }
|
||||
//
|
||||
// if (!zone->pathing)
|
||||
// {
|
||||
// // if no pathing bits available, make them available.
|
||||
// zone->pathing = new PathManager();
|
||||
// }
|
||||
//
|
||||
// if (zone->pathing)
|
||||
// {
|
||||
// zone->pathing->ConnectNodeToNode(node1, node2, teleport, doorid);
|
||||
// Log(Logs::Moderate, Logs::Quests, "QuestManager::ConnectNodeToNode connecting node %i to node %i.", node1, node2);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
void QuestManager::AddNode(float x, float y, float z, float best_z, int32 requested_id)
|
||||
{
|
||||
if (!x || !y || !z)
|
||||
{
|
||||
Log(Logs::General, Logs::Quests, "QuestManager::AddNode called without x, y, z. Probably syntax error in quest file.");
|
||||
}
|
||||
//PATHING TODO
|
||||
|
||||
if (!best_z || best_z == 0)
|
||||
{
|
||||
if (zone->zonemap)
|
||||
{
|
||||
glm::vec3 loc(x, y, z);
|
||||
best_z = zone->zonemap->FindBestZ(loc, nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
best_z = z;
|
||||
}
|
||||
}
|
||||
|
||||
if (!requested_id)
|
||||
{
|
||||
requested_id = 0;
|
||||
}
|
||||
|
||||
if (!zone->pathing)
|
||||
{
|
||||
// if no pathing bits available, make them available.
|
||||
zone->pathing = new PathManager();
|
||||
}
|
||||
|
||||
if (zone->pathing)
|
||||
{
|
||||
zone->pathing->AddNode(x, y, z, best_z, requested_id);
|
||||
Log(Logs::Moderate, Logs::Quests, "QuestManager::AddNode adding node at (%i, %i, %i).", x, y, z);
|
||||
}
|
||||
//if (!x || !y || !z)
|
||||
//{
|
||||
// Log(Logs::General, Logs::Quests, "QuestManager::AddNode called without x, y, z. Probably syntax error in quest file.");
|
||||
//}
|
||||
//
|
||||
//if (!best_z || best_z == 0)
|
||||
//{
|
||||
// if (zone->zonemap)
|
||||
// {
|
||||
// glm::vec3 loc(x, y, z);
|
||||
// best_z = zone->zonemap->FindBestZ(loc, nullptr);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// best_z = z;
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//if (!requested_id)
|
||||
//{
|
||||
// requested_id = 0;
|
||||
//}
|
||||
//
|
||||
//if (!zone->pathing)
|
||||
//{
|
||||
// // if no pathing bits available, make them available.
|
||||
// zone->pathing = new PathManager();
|
||||
//}
|
||||
//
|
||||
//if (zone->pathing)
|
||||
//{
|
||||
// zone->pathing->AddNode(x, y, z, best_z, requested_id);
|
||||
// Log(Logs::Moderate, Logs::Quests, "QuestManager::AddNode adding node at (%i, %i, %i).", x, y, z);
|
||||
//}
|
||||
}
|
||||
|
||||
void QuestManager::settarget(const char *type, int target_id) {
|
||||
|
||||
Reference in New Issue
Block a user