Write completed NPC paths to gruntwork

This commit is contained in:
gsemaj 2021-05-04 20:23:06 -04:00 committed by Gent Semaj
parent c7e2e66a51
commit 89a32ac9a4
1 changed files with 26 additions and 0 deletions

View File

@ -1268,5 +1268,31 @@ void TableData::flush() {
gruntwork["eggs"].push_back(egg);
}
for (auto& path : FinishedNPCPaths) {
json pathObj;
json points;
json targets;
for (Vec3& coord : path.points) {
json point;
point["iX"] = coord.x;
point["iY"] = coord.y;
point["iZ"] = coord.z;
point["iStopTicks"] = 0;
points.push_back(point);
}
for (int32_t tID : path.targetIDs)
targets.push_back(tID);
pathObj["iBaseSpeed"] = path.speed;
pathObj["iTaskID"] = path.escortTaskID;
pathObj["bRelative"] = path.isRelative;
pathObj["aPoints"] = points;
pathObj["aNPCIDs"] = targets;
gruntwork["paths"].push_back(pathObj);
}
file << gruntwork << std::endl;
}