Fix build after recent cherry-picks

- Rename fields in TaxiPathNodeEntry to match 6.x names
- Add LowType to ObjectGuid
This commit is contained in:
DDuarte committed 2015-05-19 12:30:06 +01:00
1 parent 95b5e35745
commit 916ce6f4f3
10 files changed
+68 -66

No files matched your search

+3 -3
View File
@@ -560,8 +560,8 @@ void LoadDBCStores(const std::string& dataPath)
for (uint32 i = 1; i < sTaxiPathNodeStore.GetNumRows(); ++i)
if (TaxiPathNodeEntry const* entry = sTaxiPathNodeStore.LookupEntry(i))
{
if (pathLength[entry->path] < entry->index + 1)
pathLength[entry->path] = entry->index + 1;
if (pathLength[entry->PathID] < entry->NodeIndex + 1)
pathLength[entry->PathID] = entry->NodeIndex + 1;
}
// Set path length
sTaxiPathNodesByPath.resize(pathCount); // 0 and some other indexes not used
@@ -570,7 +570,7 @@ void LoadDBCStores(const std::string& dataPath)
// fill data
for (uint32 i = 1; i < sTaxiPathNodeStore.GetNumRows(); ++i)
if (TaxiPathNodeEntry const* entry = sTaxiPathNodeStore.LookupEntry(i))
sTaxiPathNodesByPath[entry->path].set(entry->index, entry);
sTaxiPathNodesByPath[entry->PathID].set(entry->NodeIndex, entry);
// Initialize global taxinodes mask
// include existed nodes that have at least single not spell base (scripted) path
+11 -11
View File
@@ -1939,17 +1939,17 @@ struct TaxiPathEntry
struct TaxiPathNodeEntry
{
// 0 m_ID
uint32 path; // 1 m_PathID
uint32 index; // 2 m_NodeIndex
uint32 mapid; // 3 m_ContinentID
float x; // 4 m_LocX
float y; // 5 m_LocY
float z; // 6 m_LocZ
uint32 actionFlag; // 7 m_flags
uint32 delay; // 8 m_delay
uint32 arrivalEventID; // 9 m_arrivalEventID
uint32 departureEventID; // 10 m_departureEventID
// 0 ID
uint32 PathID; // 1
uint32 NodeIndex; // 2
uint32 MapID; // 3
float LocX; // 4
float LocY; // 5
float LocZ; // 6
uint32 Flags; // 7
uint32 Delay; // 8
uint32 ArrivalEventID; // 9
uint32 DepartureEventID; // 10
};
struct TeamContributionPointsEntry
+7 -5
View File
@@ -83,10 +83,12 @@ class ObjectGuid
public:
static ObjectGuid const Empty;
typedef uint32 LowType;
ObjectGuid() : _guid(0) { }
explicit ObjectGuid(uint64 guid) : _guid(guid) { }
ObjectGuid(HighGuid hi, uint32 entry, uint32 counter) : _guid(counter ? uint64(counter) | (uint64(entry) << 24) | (uint64(hi) << 48) : 0) { }
ObjectGuid(HighGuid hi, uint32 counter) : _guid(counter ? uint64(counter) | (uint64(hi) << 48) : 0) { }
ObjectGuid(HighGuid hi, uint32 entry, LowType counter) : _guid(counter ? uint64(counter) | (uint64(entry) << 24) | (uint64(hi) << 48) : 0) { }
ObjectGuid(HighGuid hi, LowType counter) : _guid(counter ? uint64(counter) | (uint64(hi) << 48) : 0) { }
operator uint64() const { return _guid; }
PackedGuidReader ReadAsPacked() { return PackedGuidReader(*this); }
@@ -99,11 +101,11 @@ class ObjectGuid
uint64 GetRawValue() const { return _guid; }
HighGuid GetHigh() const { return HighGuid((_guid >> 48) & 0x0000FFFF); }
uint32 GetEntry() const { return HasEntry() ? uint32((_guid >> 24) & UI64LIT(0x0000000000FFFFFF)) : 0; }
uint32 GetCounter() const
LowType GetCounter() const
{
return HasEntry()
? uint32(_guid & UI64LIT(0x0000000000FFFFFF))
: uint32(_guid & UI64LIT(0x00000000FFFFFFFF));
? LowType(_guid & UI64LIT(0x0000000000FFFFFF))
: LowType(_guid & UI64LIT(0x00000000FFFFFFFF));
}
static uint32 GetMaxCounter(HighGuid high)
+10 -10
View File
@@ -21522,9 +21522,9 @@ void Player::ContinueTaxiFlight()
float distPrev = MAP_SIZE*MAP_SIZE;
float distNext =
(nodeList[0].x-GetPositionX())*(nodeList[0].x-GetPositionX())+
(nodeList[0].y-GetPositionY())*(nodeList[0].y-GetPositionY())+
(nodeList[0].z-GetPositionZ())*(nodeList[0].z-GetPositionZ());
(nodeList[0].LocX-GetPositionX())*(nodeList[0].LocX-GetPositionX())+
(nodeList[0].LocY-GetPositionY())*(nodeList[0].LocY-GetPositionY())+
(nodeList[0].LocZ-GetPositionZ())*(nodeList[0].LocZ-GetPositionZ());
for (uint32 i = 1; i < nodeList.size(); ++i)
{
@@ -21532,20 +21532,20 @@ void Player::ContinueTaxiFlight()
TaxiPathNodeEntry const& prevNode = nodeList[i-1];
// skip nodes at another map
if (node.mapid != GetMapId())
if (node.MapID != GetMapId())
continue;
distPrev = distNext;
distNext =
(node.x-GetPositionX())*(node.x-GetPositionX())+
(node.y-GetPositionY())*(node.y-GetPositionY())+
(node.z-GetPositionZ())*(node.z-GetPositionZ());
(node.LocX-GetPositionX())*(node.LocX-GetPositionX())+
(node.LocY-GetPositionY())*(node.LocY-GetPositionY())+
(node.LocZ-GetPositionZ())*(node.LocZ-GetPositionZ());
float distNodes =
(node.x-prevNode.x)*(node.x-prevNode.x)+
(node.y-prevNode.y)*(node.y-prevNode.y)+
(node.z-prevNode.z)*(node.z-prevNode.z);
(node.LocX-prevNode.LocX)*(node.LocX-prevNode.LocX)+
(node.LocY-prevNode.LocY)*(node.LocY-prevNode.LocY)+
(node.LocZ-prevNode.LocZ)*(node.LocZ-prevNode.LocZ);
if (distNext + distPrev < distNodes)
{
@@ -173,13 +173,13 @@ void Transport::Update(uint32 diff)
MoveToNextWaypoint();
sScriptMgr->OnRelocate(this, _currentFrame->Node->index, _currentFrame->Node->mapid, _currentFrame->Node->x, _currentFrame->Node->y, _currentFrame->Node->z);
sScriptMgr->OnRelocate(this, _currentFrame->Node->NodeIndex, _currentFrame->Node->MapID, _currentFrame->Node->LocX, _currentFrame->Node->LocY, _currentFrame->Node->LocZ);
TC_LOG_DEBUG("entities.transport", "Transport %u (%s) moved to node %u %u %f %f %f", GetEntry(), GetName().c_str(), _currentFrame->Node->index, _currentFrame->Node->mapid, _currentFrame->Node->x, _currentFrame->Node->y, _currentFrame->Node->z);
TC_LOG_DEBUG("entities.transport", "Transport %u (%s) moved to node %u %u %f %f %f", GetEntry(), GetName().c_str(), _currentFrame->Node->NodeIndex, _currentFrame->Node->MapID, _currentFrame->Node->LocX, _currentFrame->Node->LocY, _currentFrame->Node->LocZ);
// Departure event
if (_currentFrame->IsTeleportFrame())
if (TeleportTransport(_nextFrame->Node->mapid, _nextFrame->Node->x, _nextFrame->Node->y, _nextFrame->Node->z, _nextFrame->InitialOrientation))
if (TeleportTransport(_nextFrame->Node->MapID, _nextFrame->Node->LocX, _nextFrame->Node->LocY, _nextFrame->Node->LocZ, _nextFrame->InitialOrientation))
return; // Update more in new map thread
}
@@ -633,9 +633,9 @@ void Transport::DelayedTeleportTransport()
GetMap()->RemoveFromMap<Transport>(this, false);
SetMap(newMap);
float x = _nextFrame->Node->Loc.X,
y = _nextFrame->Node->Loc.Y,
z = _nextFrame->Node->Loc.Z,
float x = _nextFrame->Node->LocX,
y = _nextFrame->Node->LocY,
z = _nextFrame->Node->LocZ,
o =_nextFrame->InitialOrientation;
for (_passengerTeleportItr = _passengers.begin(); _passengerTeleportItr != _passengers.end();)
@@ -719,9 +719,9 @@ void Transport::UpdatePassengerPositions(PassengerSet& passengers)
void Transport::DoEventIfAny(KeyFrame const& node, bool departure)
{
if (uint32 eventid = departure ? node.Node->departureEventID : node.Node->arrivalEventID)
if (uint32 eventid = departure ? node.Node->DepartureEventID : node.Node->ArrivalEventID)
{
TC_LOG_DEBUG("maps.script", "Taxi %s event %u of node %u of %s path", departure ? "departure" : "arrival", eventid, node.Node->index, GetName().c_str());
TC_LOG_DEBUG("maps.script", "Taxi %s event %u of node %u of %s path", departure ? "departure" : "arrival", eventid, node.Node->NodeIndex, GetName().c_str());
GetMap()->ScriptsStart(sEventScripts, eventid, this, this);
EventInform(eventid);
}
+4 -4
View File
@@ -5001,11 +5001,11 @@ void ObjectMgr::LoadEventScripts()
{
TaxiPathNodeEntry const& node = sTaxiPathNodesByPath[path_idx][node_idx];
if (node.arrivalEventID)
evt_scripts.insert(node.arrivalEventID);
if (node.ArrivalEventID)
evt_scripts.insert(node.ArrivalEventID);
if (node.departureEventID)
evt_scripts.insert(node.departureEventID);
if (node.DepartureEventID)
evt_scripts.insert(node.DepartureEventID);
}
}
+1 -1
View File
@@ -237,7 +237,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData)
TaxiPathNodeEntry const& node = flight->GetPath()[flight->GetCurrentNode()];
flight->SkipCurrentNode();
GetPlayer()->TeleportTo(curDestNode->map_id, node.x, node.y, node.z, GetPlayer()->GetOrientation());
GetPlayer()->TeleportTo(curDestNode->map_id, node.LocX, node.LocY, node.LocZ, GetPlayer()->GetOrientation());
}
return;
}
+12 -12
View File
@@ -112,7 +112,7 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl
Movement::PointsArray splinePath, allPoints;
bool mapChange = false;
for (size_t i = 0; i < path.size(); ++i)
allPoints.push_back(G3D::Vector3(path[i].x, path[i].y, path[i].z));
allPoints.push_back(G3D::Vector3(path[i].LocX, path[i].LocY, path[i].LocZ));
// Add extra points to allow derivative calculations for all path nodes
allPoints.insert(allPoints.begin(), allPoints.front().lerp(allPoints[1], -0.2f));
@@ -129,7 +129,7 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl
if (!mapChange)
{
TaxiPathNodeEntry const& node_i = path[i];
if (i != path.size() - 1 && (node_i.actionFlag & 1 || node_i.mapid != path[i + 1].mapid))
if (i != path.size() - 1 && (node_i.Flags & 1 || node_i.MapID != path[i + 1].MapID))
{
keyFrames.back().Teleport = true;
mapChange = true;
@@ -142,8 +142,8 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl
k.InitialOrientation = Position::NormalizeOrientation(std::atan2(h.y, h.x) + float(M_PI));
keyFrames.push_back(k);
splinePath.push_back(G3D::Vector3(node_i.x, node_i.y, node_i.z));
transport->mapsUsed.insert(k.Node->mapid);
splinePath.push_back(G3D::Vector3(node_i.LocX, node_i.LocY, node_i.LocZ));
transport->mapsUsed.insert(k.Node->MapID);
}
}
else
@@ -153,12 +153,12 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl
if (splinePath.size() >= 2)
{
// Remove special catmull-rom spline points
if (!keyFrames.front().IsStopFrame() && !keyFrames.front().Node->arrivalEventID && !keyFrames.front().Node->departureEventID)
if (!keyFrames.front().IsStopFrame() && !keyFrames.front().Node->ArrivalEventID && !keyFrames.front().Node->DepartureEventID)
{
splinePath.erase(splinePath.begin());
keyFrames.erase(keyFrames.begin());
}
if (!keyFrames.back().IsStopFrame() && !keyFrames.back().Node->arrivalEventID && !keyFrames.back().Node->departureEventID)
if (!keyFrames.back().IsStopFrame() && !keyFrames.back().Node->ArrivalEventID && !keyFrames.back().Node->DepartureEventID)
{
splinePath.pop_back();
keyFrames.pop_back();
@@ -311,7 +311,7 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl
float curPathTime = 0.0f;
if (keyFrames[0].IsStopFrame())
{
curPathTime = float(keyFrames[0].Node->delay);
curPathTime = float(keyFrames[0].Node->Delay);
keyFrames[0].DepartureTime = uint32(curPathTime * IN_MILLISECONDS);
}
@@ -322,7 +322,7 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl
{
keyFrames[i].ArriveTime = uint32(curPathTime * IN_MILLISECONDS);
keyFrames[i - 1].NextArriveTime = keyFrames[i].ArriveTime;
curPathTime += float(keyFrames[i].Node->delay);
curPathTime += float(keyFrames[i].Node->Delay);
keyFrames[i].DepartureTime = uint32(curPathTime * IN_MILLISECONDS);
}
else
@@ -374,10 +374,10 @@ Transport* TransportMgr::CreateTransport(uint32 entry, uint32 guid /*= 0*/, Map*
// ...at first waypoint
TaxiPathNodeEntry const* startNode = tInfo->keyFrames.begin()->Node;
uint32 mapId = startNode->mapid;
float x = startNode->x;
float y = startNode->y;
float z = startNode->z;
uint32 mapId = startNode->MapID;
float x = startNode->LocX;
float y = startNode->LocY;
float z = startNode->LocZ;
float o = tInfo->keyFrames.begin()->InitialOrientation;
// initialize the gameobject base
+1 -1
View File
@@ -61,7 +61,7 @@ struct KeyFrame
uint32 NextArriveTime;
bool IsTeleportFrame() const { return Teleport; }
bool IsStopFrame() const { return Node->actionFlag == 2; }
bool IsStopFrame() const { return Node->Flags == 2; }
};
struct TransportTemplate
@@ -248,10 +248,10 @@ uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const
if (i_currentNode >= i_path->size())
return i_path->size();
uint32 curMapId = (*i_path)[i_currentNode].mapid;
uint32 curMapId = (*i_path)[i_currentNode].MapID;
for (uint32 i = i_currentNode; i < i_path->size(); ++i)
{
if ((*i_path)[i].mapid != curMapId)
if ((*i_path)[i].MapID != curMapId)
return i;
}
@@ -296,7 +296,7 @@ void FlightPathMovementGenerator::DoReset(Player* player)
uint32 end = GetPathAtMapEnd();
for (uint32 i = GetCurrentNode(); i != end; ++i)
{
G3D::Vector3 vertice((*i_path)[i].x, (*i_path)[i].y, (*i_path)[i].z);
G3D::Vector3 vertice((*i_path)[i].LocX, (*i_path)[i].LocY, (*i_path)[i].LocZ);
init.Path().push_back(vertice);
}
init.SetFirstPointId(GetCurrentNode());
@@ -332,10 +332,10 @@ void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport()
if (i_path->empty())
return;
uint32 map0 = (*i_path)[0].mapid;
uint32 map0 = (*i_path)[0].MapID;
for (size_t i = 1; i < i_path->size(); ++i)
{
if ((*i_path)[i].mapid != map0)
if ((*i_path)[i].MapID != map0)
{
i_currentNode = i;
return;
@@ -345,9 +345,9 @@ void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport()
void FlightPathMovementGenerator::DoEventIfAny(Player* player, TaxiPathNodeEntry const& node, bool departure)
{
if (uint32 eventid = departure ? node.departureEventID : node.arrivalEventID)
if (uint32 eventid = departure ? node.DepartureEventID : node.ArrivalEventID)
{
TC_LOG_DEBUG("maps.script", "Taxi %s event %u of node %u of path %u for player %s", departure ? "departure" : "arrival", eventid, node.index, node.path, player->GetName().c_str());
TC_LOG_DEBUG("maps.script", "Taxi %s event %u of node %u of path %u for player %s", departure ? "departure" : "arrival", eventid, node.NodeIndex, node.PathID, player->GetName().c_str());
player->GetMap()->ScriptsStart(sEventScripts, eventid, player, player);
}
}
@@ -355,7 +355,7 @@ void FlightPathMovementGenerator::DoEventIfAny(Player* player, TaxiPathNodeEntry
bool FlightPathMovementGenerator::GetResetPos(Player*, float& x, float& y, float& z)
{
const TaxiPathNodeEntry& node = (*i_path)[i_currentNode];
x = node.x; y = node.y; z = node.z;
x = node.LocX; y = node.LocY; z = node.LocZ;
return true;
}
@@ -364,10 +364,10 @@ void FlightPathMovementGenerator::InitEndGridInfo()
/*! Storage to preload flightmaster grid at end of flight. For multi-stop flights, this will
be reinitialized for each flightmaster at the end of each spline (or stop) in the flight. */
uint32 nodeCount = (*i_path).size(); //! Number of nodes in path.
_endMapId = (*i_path)[nodeCount - 1].mapid; //! MapId of last node
_endMapId = (*i_path)[nodeCount - 1].MapID; //! MapId of last node
_preloadTargetNode = nodeCount - 3;
_endGridX = (*i_path)[nodeCount - 1].x;
_endGridY = (*i_path)[nodeCount - 1].y;
_endGridX = (*i_path)[nodeCount - 1].LocX;
_endGridY = (*i_path)[nodeCount - 1].LocZ;
}
void FlightPathMovementGenerator::PreloadEndGrid()