aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2011-05-26 23:51:34 +0200
committerShauren <shauren.trinity@gmail.com>2011-05-26 23:51:34 +0200
commitf91136b94921c87ec56aae9bd7194ccaba5fabbe (patch)
treeda567260f301fa3831feefc8c26186d190317c3d /src
parent00f6164a683266131dc6dcaf9ce52272d98cd4f2 (diff)
Core/Vehicles: Corrected vehicle spell bar packet, now empty slots will remain empty and spells will not be "packed" together anymore
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 20751cf5db0..914db049216 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -19381,32 +19381,29 @@ void Player::VehicleSpellInitialize()
if (!veh)
return;
- // GetPosition_ is not a member of 'Vehicle', SetPosition is a member of 'Player': SetPosition(GetVehicle()->GetPositionX(), GetVehicle()->GetPositionY(), GetVehicle()->GetPositionZ(), GetVehicle()->GetOrientation());
-
- // GetPosition_ is not a member of 'Vehicle', SetPosition is a member of 'Player': SetPosition(GetVehicle()->GetPositionX(), GetVehicle()->GetPositionY(), GetVehicle()->GetPositionZ(), GetVehicle()->GetOrientation());
-
- WorldPacket data(SMSG_PET_SPELLS, 8+2+4+4+4*10+1+1);
+ WorldPacket data(SMSG_PET_SPELLS, 8 + 2 + 4 + 4 + 4 * 10 + 1 + 1 + 4 + 10); // last 10 is just 10 bytes with unknown meaning
data << uint64(veh->GetGUID());
- data << uint16(0);
+ data << uint16(veh->GetCreatureInfo()->family);
data << uint32(0);
data << uint32(0x00000101);
for (uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i)
{
- uint32 spellId = veh->ToCreature()->m_spells[i];
- if (!spellId)
- continue;
-
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
- if (!spellInfo)
+ uint32 spellId = veh->m_spells[i];
+ if (!sSpellStore.LookupEntry(spellId))
+ {
+ data << uint16(0) << uint8(0) << uint8(i+8);
continue;
+ }
- ConditionList conditions = sConditionMgr->GetConditionsForVehicleSpell(veh->ToCreature()->GetEntry(), spellId);
+ ConditionList conditions = sConditionMgr->GetConditionsForVehicleSpell(veh->GetEntry(), spellId);
if (!sConditionMgr->IsPlayerMeetToConditions(this, conditions))
{
sLog->outDebug(LOG_FILTER_CONDITIONSYS, "VehicleSpellInitialize: conditions not met for Vehicle entry %u spell %u", veh->ToCreature()->GetEntry(), spellId);
+ data << uint16(0) << uint8(0) << uint8(i+8);
continue;
}
+
if (IsPassiveSpell(spellId))
{
veh->CastSpell(veh, spellId, true);
@@ -19421,6 +19418,13 @@ void Player::VehicleSpellInitialize()
data << uint8(0);
data << uint8(0);
+ data << uint32(0); // some spell id (unk meaning)
+
+ // there are 10 more bytes here so just append them here
+ // their meaning or true layout is unknown
+ for (uint32 i = 0; i < 10; ++i)
+ data << uint8(0);
+
GetSession()->SendPacket(&data);
}