mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Core/Server: 3785a35 followup
This commit is contained in:
@@ -24607,8 +24607,8 @@ void Player::ResyncRunes() const
|
||||
for (uint32 itr = 0; itr < MAX_RUNES; ++itr)
|
||||
{
|
||||
uint8 type = GetCurrentRune(itr);
|
||||
uint32 value = uint32(255) - ((GetRuneCooldown(itr) * uint32(255)) / uint32(RUNE_BASE_COOLDOWN)); // cooldown time (0-255)
|
||||
packet.Cooldowns.emplace_back(type, value);
|
||||
uint32 cooldown = uint32(255) - ((GetRuneCooldown(itr) * uint32(255)) / uint32(RUNE_BASE_COOLDOWN)); // cooldown time (0-255)
|
||||
packet.Runes.emplace_back(type, cooldown);
|
||||
}
|
||||
SendDirectMessage(packet.Write());
|
||||
}
|
||||
|
||||
@@ -162,10 +162,10 @@ WorldPacket const* WorldPackets::Spells::SpellStart::Write()
|
||||
WorldPacket const* WorldPackets::Spells::ResyncRunes::Write()
|
||||
{
|
||||
_worldPacket << Count;
|
||||
for (auto itr = Cooldowns.begin(); itr != Cooldowns.end(); ++itr)
|
||||
for (WorldPackets::Spells::ResyncRune const& rune : Runes)
|
||||
{
|
||||
_worldPacket << itr->first;
|
||||
_worldPacket << itr->second;
|
||||
_worldPacket << rune.RuneType;
|
||||
_worldPacket << rune.Cooldown;
|
||||
}
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
@@ -114,6 +114,12 @@ namespace WorldPackets
|
||||
SpellCastData Cast;
|
||||
};
|
||||
|
||||
struct ResyncRune
|
||||
{
|
||||
uint8 RuneType = 0;
|
||||
uint8 Cooldown = 0;
|
||||
};
|
||||
|
||||
class ResyncRunes final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
@@ -122,7 +128,7 @@ namespace WorldPackets
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
uint32 Count = 0;
|
||||
std::vector<std::pair<uint8, uint8>> Cooldowns;
|
||||
std::vector<ResyncRune> Runes;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user