aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2012-08-14 15:29:43 +0200
committerShauren <shauren.trinity@gmail.com>2012-08-14 15:29:43 +0200
commite761458b249b8f2a128867ea0bd7adf5eaec4769 (patch)
tree6097e4e41ca23800423cac99cce66cc119bb82b9
parenta768bba3c67e8c663ba95851dfedf2b300dfdee3 (diff)
Core/Taxi: Updated taxi mask building
-rw-r--r--src/server/game/DataStores/DBCStores.cpp6
-rw-r--r--src/server/game/DataStores/DBCStructure.h4
-rw-r--r--src/server/game/Entities/Player/Player.cpp8
-rwxr-xr-xsrc/server/game/Entities/Player/Player.h8
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp6
-rwxr-xr-xsrc/server/game/Handlers/TaxiHandler.cpp6
-rw-r--r--src/server/game/Server/Protocol/Opcodes.cpp2
7 files changed, 20 insertions, 20 deletions
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index a42c7257eb6..9a1702903d7 100644
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -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)
diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h
index c5344adbc8d..948647dd6ab 100644
--- a/src/server/game/DataStores/DBCStructure.h
+++ b/src/server/game/DataStores/DBCStructure.h
@@ -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
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 108e4b05e08..bd835db1ca6 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -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);
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index c8c132b56f3..a8e9e5ed407 100755
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -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;
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index c63f599cd45..6dbe7574cd2 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -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)
diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp
index 2a16efaf88b..a3e7959cdeb 100755
--- a/src/server/game/Handlers/TaxiHandler.cpp
+++ b/src/server/game/Handlers/TaxiHandler.cpp
@@ -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);
diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp
index a9a45a21e9d..0ceeb2db1ed 100644
--- a/src/server/game/Server/Protocol/Opcodes.cpp
+++ b/src/server/game/Server/Protocol/Opcodes.cpp
@@ -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 );