Core/Taxi: Updated taxi mask building
This commit is contained in:
1 parent
a768bba3c6
commit
e761458b24
7 files changed
+20
-20
No files matched your search
@@ -689,10 +689,10 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
}
|
||||
|
||||
// valid taxi network node
|
||||
uint8 field = (uint8)((i - 1) / 32);
|
||||
uint32 submask = 1<<((i-1)%32);
|
||||
sTaxiNodesMask[field] |= submask;
|
||||
uint8 field = (uint8)((i - 1) / 8);
|
||||
uint32 submask = 1 << ((i-1) % 8);
|
||||
|
||||
sTaxiNodesMask[field] |= submask;
|
||||
if (node->MountCreatureID[0] && node->MountCreatureID[0] != 32981)
|
||||
sHordeTaxiNodesMask[field] |= submask;
|
||||
if (node->MountCreatureID[1] && node->MountCreatureID[1] != 32981)
|
||||
|
||||
@@ -2429,6 +2429,6 @@ struct TaxiPathNodePtr
|
||||
typedef Path<TaxiPathNodePtr, TaxiPathNodeEntry const> TaxiPathNodeList;
|
||||
typedef std::vector<TaxiPathNodeList> TaxiPathNodesByPath;
|
||||
|
||||
#define TaxiMaskSize 25
|
||||
typedef uint32 TaxiMask[TaxiMaskSize];
|
||||
#define TaxiMaskSize 114
|
||||
typedef uint8 TaxiMask[TaxiMaskSize];
|
||||
#endif
|
||||
@@ -195,12 +195,12 @@ void PlayerTaxi::AppendTaximaskTo(ByteBuffer& data, bool all)
|
||||
data << uint32(TaxiMaskSize);
|
||||
if (all)
|
||||
{
|
||||
for (uint8 i=0; i< TaxiMaskSize; i++)
|
||||
for (uint8 i = 0; i < TaxiMaskSize; ++i)
|
||||
data << uint8(sTaxiNodesMask[i]); // all existed nodes
|
||||
}
|
||||
else
|
||||
{
|
||||
for (uint8 i=0; i < TaxiMaskSize; i++)
|
||||
for (uint8 i = 0; i < TaxiMaskSize; ++i)
|
||||
data << uint8(m_taximask[i]); // known nodes
|
||||
}
|
||||
}
|
||||
@@ -269,7 +269,7 @@ uint32 PlayerTaxi::GetCurrentTaxiPath() const
|
||||
std::ostringstream& operator<< (std::ostringstream& ss, PlayerTaxi const& taxi)
|
||||
{
|
||||
for (uint8 i = 0; i < TaxiMaskSize; ++i)
|
||||
ss << taxi.m_taximask[i] << ' ';
|
||||
ss << uint32(taxi.m_taximask[i]) << ' ';
|
||||
return ss;
|
||||
}
|
||||
|
||||
@@ -3270,7 +3270,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
|
||||
|
||||
SetFloatValue(PLAYER_PARRY_PERCENTAGE, 0.0f);
|
||||
SetFloatValue(PLAYER_BLOCK_PERCENTAGE, 0.0f);
|
||||
|
||||
|
||||
// Static 30% damage blocked
|
||||
SetUInt32Value(PLAYER_SHIELD_BLOCK, 30);
|
||||
|
||||
|
||||
@@ -886,14 +886,14 @@ class PlayerTaxi
|
||||
|
||||
bool IsTaximaskNodeKnown(uint32 nodeidx) const
|
||||
{
|
||||
uint8 field = uint8((nodeidx - 1) / 32);
|
||||
uint32 submask = 1<<((nodeidx-1)%32);
|
||||
uint8 field = uint8((nodeidx - 1) / 8);
|
||||
uint32 submask = 1 << ((nodeidx-1) % 8);
|
||||
return (m_taximask[field] & submask) == submask;
|
||||
}
|
||||
bool SetTaximaskNode(uint32 nodeidx)
|
||||
{
|
||||
uint8 field = uint8((nodeidx - 1) / 32);
|
||||
uint32 submask = 1<<((nodeidx-1)%32);
|
||||
uint8 field = uint8((nodeidx - 1) / 8);
|
||||
uint32 submask = 1 << ((nodeidx-1) % 8);
|
||||
if ((m_taximask[field] & submask) != submask)
|
||||
{
|
||||
m_taximask[field] |= submask;
|
||||
|
||||
@@ -5484,8 +5484,8 @@ uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, ui
|
||||
if (!node || node->map_id != mapid || (!node->MountCreatureID[team == ALLIANCE ? 1 : 0] && node->MountCreatureID[0] != 32981)) // dk flight
|
||||
continue;
|
||||
|
||||
uint8 field = (uint8)((i - 1) / 32);
|
||||
uint32 submask = 1<<((i-1)%32);
|
||||
uint8 field = (uint8)((i - 1) / 8);
|
||||
uint32 submask = 1 << ((i-1) % 8);
|
||||
|
||||
// skip not taxi network nodes
|
||||
if ((sTaxiNodesMask[field] & submask) == 0)
|
||||
@@ -6804,7 +6804,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
|
||||
|
||||
_repSpilloverTemplateStore.clear(); // for reload case
|
||||
|
||||
uint32 count = 0; // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
||||
uint32 count = 0; // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
||||
QueryResult result = WorldDatabase.Query("SELECT faction, faction1, rate_1, rank_1, faction2, rate_2, rank_2, faction3, rate_3, rank_3, faction4, rate_4, rank_4, faction5, rate_5, rank_5 FROM reputation_spillover_template");
|
||||
|
||||
if (!result)
|
||||
|
||||
@@ -94,12 +94,12 @@ void WorldSession::SendTaxiMenu(Creature* unit)
|
||||
{
|
||||
// find current node
|
||||
uint32 curloc = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetMapId(), GetPlayer()->GetTeam());
|
||||
|
||||
if (curloc == 0)
|
||||
if (!curloc)
|
||||
return;
|
||||
|
||||
bool lastTaxiCheaterState = GetPlayer()->isTaxiCheater();
|
||||
if (unit->GetEntry() == 29480) GetPlayer()->SetTaxiCheater(true); // Grimwing in Ebon Hold, special case. NOTE: Not perfect, Zul'Aman should not be included according to WoWhead, and I think taxicheat includes it.
|
||||
if (unit->GetEntry() == 29480)
|
||||
GetPlayer()->SetTaxiCheater(true); // Grimwing in Ebon Hold, special case. NOTE: Not perfect, Zul'Aman should not be included according to WoWhead, and I think taxicheat includes it.
|
||||
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_TAXINODE_STATUS_QUERY %u ", curloc);
|
||||
|
||||
|
||||
@@ -1011,7 +1011,7 @@ void InitOpcodes()
|
||||
DEFINE_OPCODE_HANDLER(SMSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
//DEFINE_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
//DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
//DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD_ABORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
|
||||
Reference in new issue
Block a user