Core/PacketIO: Remove undesired implicit conversions to bool with Optional updatefields
This commit is contained in:
@@ -3317,7 +3317,7 @@ void Creature::SetVendor(NPCFlags flags, bool apply)
|
||||
if (addFragment)
|
||||
m_entityFragments.Add(WowCS::EntityFragment::FVendor_C, IsInWorld(), WowCS::GetRawFragmentData(m_vendorData));
|
||||
}
|
||||
else if (m_vendorData)
|
||||
else if (m_vendorData.has_value())
|
||||
{
|
||||
RemoveNpcFlag(flags);
|
||||
RemoveUpdateFieldFlagValue(m_values.ModifyValue(&Creature::m_vendorData, 0).ModifyValue(&UF::VendorData::Flags), AsUnderlyingType(vendorFlags));
|
||||
@@ -3341,7 +3341,7 @@ void Creature::SetPetitioner(bool apply)
|
||||
if (addFragment)
|
||||
m_entityFragments.Add(WowCS::EntityFragment::FVendor_C, IsInWorld(), WowCS::GetRawFragmentData(m_vendorData));
|
||||
}
|
||||
else if (m_vendorData)
|
||||
else if (m_vendorData.has_value())
|
||||
{
|
||||
RemoveNpcFlag(UNIT_NPC_FLAG_PETITIONER);
|
||||
RemoveUpdateFieldFlagValue(m_values.ModifyValue(&Creature::m_vendorData, 0).ModifyValue(&UF::VendorData::Flags), AsUnderlyingType(VendorDataTypeFlags::Petition));
|
||||
|
||||
@@ -1249,10 +1249,6 @@ namespace UF
|
||||
return !!_value;
|
||||
}
|
||||
|
||||
operator bool() const
|
||||
{
|
||||
return has_value();
|
||||
}
|
||||
T const* operator->() const
|
||||
{
|
||||
return &(*_value);
|
||||
|
||||
@@ -4113,7 +4113,7 @@ void CraftingOrderItem::WriteCreate(ByteBuffer& data, Player const* receiver, Pl
|
||||
data.FlushBits();
|
||||
if (DataSlotIndex.has_value())
|
||||
{
|
||||
data << uint8(DataSlotIndex);
|
||||
data << uint8(*DataSlotIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4156,7 +4156,7 @@ void CraftingOrderItem::WriteUpdate(bool ignoreChangesMask, ByteBuffer& data, Pl
|
||||
{
|
||||
if (DataSlotIndex.has_value())
|
||||
{
|
||||
data << uint8(DataSlotIndex);
|
||||
data << uint8(*DataSlotIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7873,7 +7873,7 @@ void VisualAnim::WriteCreate(ByteBuffer& data, Player const* receiver, AreaTrigg
|
||||
data << uint32(AnimProgress);
|
||||
if (AnimationDataID.has_value())
|
||||
{
|
||||
data << int16(AnimationDataID);
|
||||
data << int16(*AnimationDataID);
|
||||
}
|
||||
data.FlushBits();
|
||||
}
|
||||
@@ -7909,7 +7909,7 @@ void VisualAnim::WriteUpdate(bool ignoreChangesMask, ByteBuffer& data, Player co
|
||||
{
|
||||
if (AnimationDataID.has_value())
|
||||
{
|
||||
data << int16(AnimationDataID);
|
||||
data << int16(*AnimationDataID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user