mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/PacketIO: Fixed structure of "fake" SMSG_SPELL_GO sent when loading pets from db
Closes #25354
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellPackets.h"
|
||||
#include "Unit.h"
|
||||
#include "Util.h"
|
||||
#include "WorldPacket.h"
|
||||
@@ -338,14 +339,13 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
|
||||
/// @todo pets should be summoned from real cast instead of just faking it?
|
||||
if (petInfo->CreatedBySpellId)
|
||||
{
|
||||
WorldPacket data(SMSG_SPELL_GO, (8+8+4+4+2));
|
||||
data << owner->GetPackGUID();
|
||||
data << owner->GetPackGUID();
|
||||
data << uint8(0);
|
||||
data << uint32(petInfo->CreatedBySpellId);
|
||||
data << uint32(256); // CAST_FLAG_UNKNOWN3
|
||||
data << uint32(0);
|
||||
owner->SendMessageToSet(&data, true);
|
||||
WorldPackets::Spells::SpellGo spellGo;
|
||||
spellGo.Cast.CasterGUID = owner->GetGUID();
|
||||
spellGo.Cast.CasterUnit = owner->GetGUID();
|
||||
spellGo.Cast.SpellID = petInfo->CreatedBySpellId;
|
||||
spellGo.Cast.CastFlags = CAST_FLAG_UNKNOWN_9;
|
||||
spellGo.Cast.CastTime = GameTime::GetGameTimeMS();
|
||||
owner->SendMessageToSet(spellGo.Write(), true);
|
||||
}
|
||||
|
||||
owner->SetMinion(this, true);
|
||||
|
||||
@@ -163,7 +163,11 @@ namespace WorldPackets
|
||||
class SpellGo final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
SpellGo() : ServerPacket(SMSG_SPELL_GO) { }
|
||||
SpellGo() : ServerPacket(SMSG_SPELL_GO)
|
||||
{
|
||||
Cast.HitTargets.emplace();
|
||||
Cast.MissStatus.emplace();
|
||||
}
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
|
||||
@@ -4431,9 +4431,6 @@ void Spell::UpdateSpellCastDataAmmo(WorldPackets::Spells::SpellAmmo& ammo)
|
||||
/// Writes miss and hit targets for a SMSG_SPELL_GO packet
|
||||
void Spell::UpdateSpellCastDataTargets(WorldPackets::Spells::SpellCastData& data)
|
||||
{
|
||||
data.HitTargets.emplace();
|
||||
data.MissStatus.emplace();
|
||||
|
||||
// This function also fill data for channeled spells:
|
||||
// m_needAliveTargetMask req for stop channelig if one target die
|
||||
for (TargetInfo& targetInfo : m_UniqueTargetInfo)
|
||||
|
||||
Reference in New Issue
Block a user