mirror of
https://github.com/mangosfour/server.git
synced 2025-12-26 16:37:06 +00:00
[9808] Simplify TaxiPathNodes data use, specially for transport case.
This commit is contained in:
parent
de3192b2f5
commit
4910add486
8 changed files with 29 additions and 92 deletions
|
|
@ -205,22 +205,22 @@ struct keyFrame
|
|||
|
||||
bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
|
||||
{
|
||||
TransportPath path;
|
||||
sObjectMgr.GetTransportPathNodes(pathid, path);
|
||||
|
||||
if (path.Empty())
|
||||
if (pathid >= sTaxiPathNodesByPath.size())
|
||||
return false;
|
||||
|
||||
TaxiPathNodeList const& path = sTaxiPathNodesByPath[pathid];
|
||||
|
||||
std::vector<keyFrame> keyFrames;
|
||||
int mapChange = 0;
|
||||
mapids.clear();
|
||||
for (size_t i = 1; i < path.Size() - 1; ++i)
|
||||
for (size_t i = 1; i < path.size() - 1; ++i)
|
||||
{
|
||||
if (mapChange == 0)
|
||||
{
|
||||
if ((path[i].mapid == path[i+1].mapid))
|
||||
TaxiPathNodeEntry const* node_i = path[i];
|
||||
if (node_i->mapid == path[i+1]->mapid)
|
||||
{
|
||||
keyFrame k(path[i].x, path[i].y, path[i].z, path[i].mapid, path[i].actionFlag, path[i].delay);
|
||||
keyFrame k(node_i->x, node_i->y, node_i->z, node_i->mapid, node_i->actionFlag, node_i->delay);
|
||||
keyFrames.push_back(k);
|
||||
mapids.insert(k.mapid);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue