mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/PacketIO: Fix DecorStoragePersistedData and HousingDecorData structures
This commit is contained in:
@@ -7411,7 +7411,7 @@ void VisualAnim::ClearChangesMask()
|
||||
void ForceSetAreaTriggerPositionAndRotation::WriteCreate(ByteBuffer& data, AreaTrigger const* owner, Player const* receiver) const
|
||||
{
|
||||
data << TriggerGUID;
|
||||
data << Position;
|
||||
data << Pos;
|
||||
data << float(Rotation.x);
|
||||
data << float(Rotation.y);
|
||||
data << float(Rotation.z);
|
||||
@@ -7421,7 +7421,7 @@ void ForceSetAreaTriggerPositionAndRotation::WriteCreate(ByteBuffer& data, AreaT
|
||||
void ForceSetAreaTriggerPositionAndRotation::WriteUpdate(ByteBuffer& data, bool ignoreChangesMask, AreaTrigger const* owner, Player const* receiver) const
|
||||
{
|
||||
data << TriggerGUID;
|
||||
data << Position;
|
||||
data << Pos;
|
||||
data << float(Rotation.x);
|
||||
data << float(Rotation.y);
|
||||
data << float(Rotation.z);
|
||||
@@ -7431,7 +7431,7 @@ void ForceSetAreaTriggerPositionAndRotation::WriteUpdate(ByteBuffer& data, bool
|
||||
bool ForceSetAreaTriggerPositionAndRotation::operator==(ForceSetAreaTriggerPositionAndRotation const& right) const
|
||||
{
|
||||
return TriggerGUID == right.TriggerGUID
|
||||
&& Position == right.Position
|
||||
&& Pos == right.Pos
|
||||
&& Rotation == right.Rotation;
|
||||
}
|
||||
|
||||
@@ -8614,6 +8614,7 @@ void DecorStoragePersistedData::WriteCreate(ByteBuffer& data, Object const* owne
|
||||
data << *HouseGUID;
|
||||
data << uint8(Field_20);
|
||||
data.WriteBits(Dyes.has_value(), 1);
|
||||
data.FlushBits();
|
||||
if (Dyes.has_value())
|
||||
{
|
||||
Dyes->WriteCreate(data, owner, receiver);
|
||||
@@ -8626,26 +8627,24 @@ void DecorStoragePersistedData::WriteUpdate(ByteBuffer& data, bool ignoreChanges
|
||||
if (ignoreChangesMask)
|
||||
changesMask.SetAll();
|
||||
|
||||
data.WriteBits(changesMask.GetBlock(0), 4);
|
||||
data.WriteBits(changesMask.GetBlock(0), 3);
|
||||
|
||||
data.FlushBits();
|
||||
if (changesMask[0])
|
||||
{
|
||||
if (changesMask[1])
|
||||
data << *HouseGUID;
|
||||
}
|
||||
if (changesMask[2])
|
||||
{
|
||||
data << uint8(Field_20);
|
||||
}
|
||||
data.WriteBits(Dyes.has_value(), 1);
|
||||
data.FlushBits();
|
||||
if (changesMask[1])
|
||||
{
|
||||
if (Dyes.has_value())
|
||||
{
|
||||
data << *HouseGUID;
|
||||
}
|
||||
if (changesMask[3])
|
||||
{
|
||||
data << uint8(Field_20);
|
||||
}
|
||||
data.WriteBits(Dyes.has_value(), 1);
|
||||
if (changesMask[2])
|
||||
{
|
||||
if (Dyes.has_value())
|
||||
{
|
||||
Dyes->WriteUpdate(data, ignoreChangesMask, owner, receiver);
|
||||
}
|
||||
Dyes->WriteUpdate(data, ignoreChangesMask, owner, receiver);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8663,8 +8662,9 @@ void HousingDecorData::WriteCreate(ByteBuffer& data, EnumFlag<UpdateFieldFlag> f
|
||||
data << *DecorGUID;
|
||||
data << *AttachParentGUID;
|
||||
data << uint8(Flags);
|
||||
data << *Field_68;
|
||||
data << *TargetGameObjectGUID;
|
||||
data.WriteBits(PersistedData.has_value(), 1);
|
||||
data.FlushBits();
|
||||
if (PersistedData.has_value())
|
||||
{
|
||||
PersistedData->WriteCreate(data, owner, receiver);
|
||||
@@ -8697,9 +8697,10 @@ void HousingDecorData::WriteUpdate(ByteBuffer& data, Mask const& changesMask, bo
|
||||
}
|
||||
if (changesMask[5])
|
||||
{
|
||||
data << *Field_68;
|
||||
data << *TargetGameObjectGUID;
|
||||
}
|
||||
data.WriteBits(PersistedData.has_value(), 1);
|
||||
data.FlushBits();
|
||||
if (changesMask[4])
|
||||
{
|
||||
if (PersistedData.has_value())
|
||||
@@ -8716,7 +8717,7 @@ void HousingDecorData::ClearChangesMask()
|
||||
Base::ClearChangesMask(AttachParentGUID);
|
||||
Base::ClearChangesMask(Flags);
|
||||
Base::ClearChangesMask(PersistedData);
|
||||
Base::ClearChangesMask(Field_68);
|
||||
Base::ClearChangesMask(TargetGameObjectGUID);
|
||||
_changesMask.ResetAll();
|
||||
}
|
||||
|
||||
|
||||
@@ -1383,7 +1383,7 @@ struct VisualAnim : public IsUpdateFieldStructureTag, public HasChangesMask<5>
|
||||
struct ForceSetAreaTriggerPositionAndRotation : public IsUpdateFieldStructureTag
|
||||
{
|
||||
ObjectGuid TriggerGUID;
|
||||
TaggedPosition<::Position::XYZ> Position;
|
||||
TaggedPosition<Position::XYZ> Pos;
|
||||
QuaternionData Rotation;
|
||||
|
||||
void WriteCreate(ByteBuffer& data, AreaTrigger const* owner, Player const* receiver) const;
|
||||
@@ -1649,11 +1649,11 @@ struct DecorStoragePersistedDataDyes : public IsUpdateFieldStructureTag
|
||||
bool operator!=(DecorStoragePersistedDataDyes const& right) const { return !(*this == right); }
|
||||
};
|
||||
|
||||
struct DecorStoragePersistedData : public IsUpdateFieldStructureTag, public HasChangesMask<4>
|
||||
struct DecorStoragePersistedData : public IsUpdateFieldStructureTag, public HasChangesMask<3>
|
||||
{
|
||||
UpdateField<ObjectGuid, 0, 1> HouseGUID;
|
||||
OptionalUpdateField<UF::DecorStoragePersistedDataDyes, 0, 2> Dyes;
|
||||
UpdateField<uint8, 0, 3> Field_20;
|
||||
UpdateField<ObjectGuid, -1, 0> HouseGUID;
|
||||
OptionalUpdateField<UF::DecorStoragePersistedDataDyes, -1, 1> Dyes;
|
||||
UpdateField<uint8, -1, 2> Field_20;
|
||||
|
||||
void WriteCreate(ByteBuffer& data, Object const* owner, Player const* receiver) const;
|
||||
void WriteUpdate(ByteBuffer& data, bool ignoreChangesMask, Object const* owner, Player const* receiver) const;
|
||||
@@ -1666,7 +1666,7 @@ struct HousingDecorData : public IsUpdateFieldStructureTag, public HasChangesMas
|
||||
UpdateField<ObjectGuid, 0, 2> AttachParentGUID;
|
||||
UpdateField<uint8, 0, 3> Flags;
|
||||
OptionalUpdateField<UF::DecorStoragePersistedData, 0, 4> PersistedData;
|
||||
UpdateField<ObjectGuid, 0, 5> Field_68;
|
||||
UpdateField<ObjectGuid, 0, 5> TargetGameObjectGUID;
|
||||
|
||||
void WriteCreate(ByteBuffer& data, EnumFlag<UpdateFieldFlag> fieldVisibilityFlags, Object const* owner, Player const* receiver) const;
|
||||
void WriteUpdate(ByteBuffer& data, EnumFlag<UpdateFieldFlag> fieldVisibilityFlags, Object const* owner, Player const* receiver) const;
|
||||
|
||||
Reference in New Issue
Block a user