Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion src/game/WorldHandlers/Transports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ bool GlobalTransport::GenerateWaypoints()
cM = keyFrames[i + 1].node->mapid;
}

pos = WayPoint(keyFrames[i + 1].node->mapid, keyFrames[i + 1].node->x, keyFrames[i + 1].node->y, keyFrames[i + 1].node->z, teleport);
pos = WayPoint(keyFrames[i + 1].node->mapid, keyFrames[i + 1].node->x, keyFrames[i + 1].node->y, keyFrames[i + 1].node->z, teleport, keyFrames[i + 1].node->delay > 0);

// sLog.outString("T: %d, x: %f, y: %f, z: %f, t:%d", t, pos.x, pos.y, pos.z, teleport);

Expand Down Expand Up @@ -711,6 +711,29 @@ void GlobalTransport::Update(uint32 /*update_diff*/, uint32 /*p_time*/)
else
{
Relocate(m_curr->second.x, m_curr->second.y, m_curr->second.z);
if (m_curr->second.isStop)
{
uint32 zoneId = GetZoneId();
Map::PlayerList const& pl = GetMap()->GetPlayers();
UpdateData destroyData;
BuildOutOfRangeUpdateBlock(&destroyData);
WorldPacket destroyPacket;
destroyData.BuildPacket(&destroyPacket, true);
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
{
Player* player = itr->getSource();
if (this == player->GetTransport())
continue;
if (player->GetZoneId() != zoneId)
continue;
player->SendDirectMessage(&destroyPacket);
UpdateData transData;
BuildCreateUpdateBlockForPlayer(&transData, player);
WorldPacket packet;
transData.BuildPacket(&packet, true);
player->SendDirectMessage(&packet);
}
}
UpdateCreaturePassengerPositions();
}

Expand Down
7 changes: 4 additions & 3 deletions src/game/WorldHandlers/Transports.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,15 @@ class GlobalTransport : public Transport
private:
struct WayPoint
{
WayPoint() : mapid(0), x(0), y(0), z(0), teleport(false) {}
WayPoint(uint32 _mapid, float _x, float _y, float _z, bool _teleport) :
mapid(_mapid), x(_x), y(_y), z(_z), teleport(_teleport) {}
WayPoint() : mapid(0), x(0), y(0), z(0), teleport(false), isStop(false) {}
WayPoint(uint32 _mapid, float _x, float _y, float _z, bool _teleport, bool _isStop = false) :
mapid(_mapid), x(_x), y(_y), z(_z), teleport(_teleport), isStop(_isStop) {}
uint32 mapid;
float x;
float y;
float z;
bool teleport;
bool isStop;
};

typedef std::map<uint32, WayPoint> WayPointMap;
Expand Down
Loading