mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Core/Packets: changed amount storage for aura update packets from vector to array to improve performance
This commit is contained in:
@@ -225,8 +225,9 @@ ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::AuraDataInfo cons
|
||||
if (auraData.Remaining)
|
||||
data << int32(*auraData.Remaining);
|
||||
|
||||
for (int32 amount : auraData.Points)
|
||||
data << int32(amount);
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (auraData.Points[i].is_initialized())
|
||||
data << int32(*auraData.Points[i]);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ namespace WorldPackets
|
||||
Optional<ObjectGuid> CastUnit;
|
||||
Optional<int32> Duration;
|
||||
Optional<int32> Remaining;
|
||||
std::vector<int32> Points;
|
||||
std::array<Optional<int32>, 3 /*MAX_SPELL_EFFECTS*/> Points;
|
||||
};
|
||||
|
||||
struct AuraInfo
|
||||
|
||||
@@ -221,7 +221,7 @@ void AuraApplication::BuildUpdatePacket(WorldPackets::Spells::AuraInfo& auraInfo
|
||||
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (AuraEffect const* effect = aura->GetEffect(i))
|
||||
if (HasEffect(i)) // Not all of aura's effects have to be applied on every target
|
||||
auraData.Points.push_back(effect->GetAmount());
|
||||
auraData.Points[i] = effect->GetAmount();
|
||||
}
|
||||
|
||||
void AuraApplication::ClientUpdate(bool remove)
|
||||
|
||||
Reference in New Issue
Block a user