diff --git a/src/server/game/Entities/Object/Updates/UpdateFields.cpp b/src/server/game/Entities/Object/Updates/UpdateFields.cpp index 5f1e6013196..917eb89e955 100644 --- a/src/server/game/Entities/Object/Updates/UpdateFields.cpp +++ b/src/server/game/Entities/Object/Updates/UpdateFields.cpp @@ -8478,24 +8478,6 @@ void ConversationData::ClearChangesMask() _changesMask.ResetAll(); } -void AaBox::WriteCreate(ByteBuffer& data, BaseEntity const* owner, Player const* receiver) const -{ - data << Low; - data << High; -} - -void AaBox::WriteUpdate(ByteBuffer& data, bool ignoreChangesMask, BaseEntity const* owner, Player const* receiver) const -{ - data << Low; - data << High; -} - -bool AaBox::operator==(AaBox const& right) const -{ - return Low == right.Low - && High == right.High; -} - void MeshObjectData::WriteCreate(ByteBuffer& data, EnumFlag fieldVisibilityFlags, Object const* owner, Player const* receiver) const { data.WriteBit(IsWMO); @@ -8504,7 +8486,7 @@ void MeshObjectData::WriteCreate(ByteBuffer& data, EnumFlag fie data << int32(FileDataID); if (Geobox.has_value()) { - Geobox->WriteCreate(data, owner, receiver); + data << *Geobox; } data.FlushBits(); data.FlushBits(); @@ -8542,7 +8524,7 @@ void MeshObjectData::WriteUpdate(ByteBuffer& data, Mask const& changesMask, bool { if (Geobox.has_value()) { - Geobox->WriteUpdate(data, ignoreNestedChangesMask, owner, receiver); + data << *Geobox; } } } @@ -8948,7 +8930,7 @@ void HousingPlayerHouseData::WriteCreate(ByteBuffer& data, EnumFlag fieldVisibilityFlags, AreaTrigger const* owner, Player const* receiver) const { - data << uint32(Field_0); + data << uint32(PlotID); data << *HouseOwnerGUID; data << *HouseGUID; data << *HouseOwnerBnetAccountGUID; @@ -9079,7 +9061,7 @@ void HousingPlotAreaTriggerData::WriteUpdate(ByteBuffer& data, Mask const& chang { if (changesMask[1]) { - data << uint32(Field_0); + data << uint32(PlotID); } if (changesMask[2]) { @@ -9098,7 +9080,7 @@ void HousingPlotAreaTriggerData::WriteUpdate(ByteBuffer& data, Mask const& chang void HousingPlotAreaTriggerData::ClearChangesMask() { - Base::ClearChangesMask(Field_0); + Base::ClearChangesMask(PlotID); Base::ClearChangesMask(HouseOwnerGUID); Base::ClearChangesMask(HouseGUID); Base::ClearChangesMask(HouseOwnerBnetAccountGUID); diff --git a/src/server/game/Entities/Object/Updates/UpdateFields.h b/src/server/game/Entities/Object/Updates/UpdateFields.h index 95976b87218..3e047889080 100644 --- a/src/server/game/Entities/Object/Updates/UpdateFields.h +++ b/src/server/game/Entities/Object/Updates/UpdateFields.h @@ -26,6 +26,7 @@ #include "Position.h" #include "QuaternionData.h" #include "UpdateField.h" +#include "UpdateFieldsAaBox.h" #include "UpdateMask.h" // This file is automatically generated, DO NOT EDIT @@ -1606,17 +1607,6 @@ struct ConversationData : public IsUpdateFieldStructureTag, public HasChangesMas void ClearChangesMask(); }; -struct AaBox : public IsUpdateFieldStructureTag -{ - TaggedPosition Low; - TaggedPosition High; - - void WriteCreate(ByteBuffer& data, BaseEntity const* owner, Player const* receiver) const; - void WriteUpdate(ByteBuffer& data, bool ignoreChangesMask, BaseEntity const* owner, Player const* receiver) const; - bool operator==(AaBox const& right) const; - bool operator!=(AaBox const& right) const { return !(*this == right); } -}; - struct MeshObjectData : public IsUpdateFieldStructureTag, public HasChangesMask<5> { UpdateField IsWMO; @@ -1725,7 +1715,7 @@ struct HousingPlayerHouseData : public IsUpdateFieldStructureTag, public HasChan UpdateField BnetAccount; UpdateField PlotIndex; UpdateField Level; - UpdateField Field_20; + UpdateField Favor; UpdateField InteriorDecorPlacementBudget; UpdateField ExteriorDecorPlacementBudget; UpdateField ExteriorFixtureBudget; @@ -1751,7 +1741,7 @@ struct HousingCornerstoneData : public IsUpdateFieldStructureTag, public HasChan struct HousingPlotAreaTriggerData : public IsUpdateFieldStructureTag, public HasChangesMask<5> { - UpdateField Field_0; + UpdateField PlotID; // PlotIndex, not id from NeighborhoodPlot.db2 UpdateField HouseOwnerGUID; UpdateField HouseGUID; UpdateField HouseOwnerBnetAccountGUID; diff --git a/src/server/game/Entities/Object/Updates/UpdateFieldsAaBox.h b/src/server/game/Entities/Object/Updates/UpdateFieldsAaBox.h new file mode 100644 index 00000000000..b22f3314170 --- /dev/null +++ b/src/server/game/Entities/Object/Updates/UpdateFieldsAaBox.h @@ -0,0 +1,41 @@ +/* +* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2 of the License, or (at your +* option) any later version. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along +* with this program. If not, see . +*/ + +#ifndef TRINITYCORE_UPDATE_FIELDS_AA_BOX_H +#define TRINITYCORE_UPDATE_FIELDS_AA_BOX_H + +#include "Position.h" + +namespace UF +{ +struct AaBox +{ + TaggedPosition Low; + TaggedPosition High; + + friend bool operator==(AaBox const&, AaBox const&) noexcept = default; + + friend ByteBuffer& operator<<(ByteBuffer& data, AaBox const& box) + { + data << box.Low; + data << box.High; + return data; + } +}; +} + +#endif // TRINITYCORE_UPDATE_FIELDS_AA_BOX_H