Pathing is essentially fully functional now, still could use improvements here and there

This commit is contained in:
KimLS
2016-01-13 13:39:42 -08:00
parent e61e2e7f02
commit 1cb07d055e
25 changed files with 214 additions and 2548 deletions
-73
View File
@@ -670,79 +670,6 @@ void QuestManager::repopzone() {
}
}
void QuestManager::ConnectNodeToNode(int node1, int node2, int teleport, int doorid) {
if (!node1 || !node2)
{
Log.Out(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.Out(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.Out(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.Out(Logs::Moderate, Logs::Quests, "QuestManager::AddNode adding node at (%i, %i, %i).", x, y, z);
}
}
void QuestManager::settarget(const char *type, int target_id) {
QuestManagerCurrentQuestVars();
if (!owner || !owner->IsNPC())