mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/PacketIO: Added missing move assignment operator to ByteBuffer
This commit is contained in:
@@ -172,12 +172,8 @@ uint32 CreatureTemplate::GetFirstVisibleModel() const
|
||||
|
||||
void CreatureTemplate::InitializeQueryData()
|
||||
{
|
||||
WorldPacket queryTemp;
|
||||
for (uint8 loc = LOCALE_enUS; loc < TOTAL_LOCALES; ++loc)
|
||||
{
|
||||
queryTemp = BuildQueryData(static_cast<LocaleConstant>(loc));
|
||||
QueryData[loc] = queryTemp;
|
||||
}
|
||||
QueryData[loc] = BuildQueryData(static_cast<LocaleConstant>(loc));
|
||||
}
|
||||
|
||||
WorldPacket CreatureTemplate::BuildQueryData(LocaleConstant loc) const
|
||||
@@ -219,7 +215,8 @@ WorldPacket CreatureTemplate::BuildQueryData(LocaleConstant loc) const
|
||||
queryTemp.Stats.QuestItems[i] = (*items)[i];
|
||||
|
||||
queryTemp.Stats.CreatureMovementInfoID = movementId;
|
||||
return *queryTemp.Write();
|
||||
queryTemp.Write();
|
||||
return queryTemp.Move();
|
||||
}
|
||||
|
||||
bool AssistDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
||||
|
||||
@@ -44,12 +44,8 @@
|
||||
|
||||
void GameObjectTemplate::InitializeQueryData()
|
||||
{
|
||||
WorldPacket queryTemp;
|
||||
for (uint8 loc = LOCALE_enUS; loc < TOTAL_LOCALES; ++loc)
|
||||
{
|
||||
queryTemp = BuildQueryData(static_cast<LocaleConstant>(loc));
|
||||
QueryData[loc] = queryTemp;
|
||||
}
|
||||
QueryData[loc] = BuildQueryData(static_cast<LocaleConstant>(loc));
|
||||
}
|
||||
|
||||
WorldPacket GameObjectTemplate::BuildQueryData(LocaleConstant loc) const
|
||||
@@ -86,7 +82,8 @@ WorldPacket GameObjectTemplate::BuildQueryData(LocaleConstant loc) const
|
||||
if (i < items->size())
|
||||
queryTemp.Stats.QuestItems[i] = (*items)[i];
|
||||
|
||||
return *queryTemp.Write();
|
||||
queryTemp.Write();
|
||||
return queryTemp.Move();
|
||||
}
|
||||
|
||||
bool QuaternionData::isUnit() const
|
||||
|
||||
@@ -149,12 +149,8 @@ void ItemTemplate::_LoadTotalAP()
|
||||
|
||||
void ItemTemplate::InitializeQueryData()
|
||||
{
|
||||
WorldPacket queryTemp;
|
||||
for (uint8 loc = LOCALE_enUS; loc < TOTAL_LOCALES; ++loc)
|
||||
{
|
||||
queryTemp = BuildQueryData(static_cast<LocaleConstant>(loc));
|
||||
QueryData[loc] = queryTemp;
|
||||
}
|
||||
QueryData[loc] = BuildQueryData(static_cast<LocaleConstant>(loc));
|
||||
}
|
||||
|
||||
WorldPacket ItemTemplate::BuildQueryData(LocaleConstant loc) const
|
||||
@@ -270,5 +266,6 @@ WorldPacket ItemTemplate::BuildQueryData(LocaleConstant loc) const
|
||||
response.Stats.ItemLimitCategory = ItemLimitCategory;
|
||||
response.Stats.HolidayId = HolidayId;
|
||||
|
||||
return *response.Write();
|
||||
response.Write();
|
||||
return response.Move();
|
||||
}
|
||||
|
||||
@@ -314,12 +314,8 @@ bool Quest::CanIncreaseRewardedQuestCounters() const
|
||||
|
||||
void Quest::InitializeQueryData()
|
||||
{
|
||||
WorldPacket queryTemp;
|
||||
for (uint8 loc = LOCALE_enUS; loc < TOTAL_LOCALES; ++loc)
|
||||
{
|
||||
queryTemp = BuildQueryData(static_cast<LocaleConstant>(loc));
|
||||
QueryData[loc] = queryTemp;
|
||||
}
|
||||
QueryData[loc] = BuildQueryData(static_cast<LocaleConstant>(loc));
|
||||
}
|
||||
|
||||
WorldPacket Quest::BuildQueryData(LocaleConstant loc) const
|
||||
@@ -432,7 +428,8 @@ WorldPacket Quest::BuildQueryData(LocaleConstant loc) const
|
||||
for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
response.Info.ObjectiveText[i] = locQuestObjectiveText[i];
|
||||
|
||||
return *response.Write();
|
||||
response.Write();
|
||||
return response.Move();
|
||||
}
|
||||
|
||||
void Quest::AddQuestLevelToTitle(std::string &title, int32 level)
|
||||
|
||||
@@ -47,7 +47,7 @@ class WorldPacket : public ByteBuffer
|
||||
if (this != &right)
|
||||
{
|
||||
m_opcode = right.m_opcode;
|
||||
ByteBuffer::operator =(right);
|
||||
ByteBuffer::operator=(right);
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
||||
@@ -74,11 +74,13 @@ class TC_SHARED_API ByteBuffer
|
||||
_storage.reserve(reserve);
|
||||
}
|
||||
|
||||
ByteBuffer(ByteBuffer&& buf) : _rpos(buf._rpos), _wpos(buf._wpos),
|
||||
_storage(std::move(buf._storage)) { }
|
||||
ByteBuffer(ByteBuffer&& buf) : _rpos(buf._rpos), _wpos(buf._wpos), _storage(std::move(buf._storage))
|
||||
{
|
||||
buf._rpos = 0;
|
||||
buf._wpos = 0;
|
||||
}
|
||||
|
||||
ByteBuffer(ByteBuffer const& right) : _rpos(right._rpos), _wpos(right._wpos),
|
||||
_storage(right._storage) { }
|
||||
ByteBuffer(ByteBuffer const& right) : _rpos(right._rpos), _wpos(right._wpos), _storage(right._storage) { }
|
||||
|
||||
ByteBuffer(MessageBuffer&& buffer);
|
||||
|
||||
@@ -94,6 +96,20 @@ class TC_SHARED_API ByteBuffer
|
||||
return *this;
|
||||
}
|
||||
|
||||
ByteBuffer& operator=(ByteBuffer&& right)
|
||||
{
|
||||
if (this != &right)
|
||||
{
|
||||
_rpos = right._rpos;
|
||||
right._rpos = 0;
|
||||
_wpos = right._wpos;
|
||||
right._wpos = 0;
|
||||
_storage = std::move(right._storage);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual ~ByteBuffer() { }
|
||||
|
||||
void clear()
|
||||
|
||||
Reference in New Issue
Block a user