mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Misc: Reduce code differences between branches
This commit is contained in:
@@ -44,15 +44,15 @@ class TC_GAME_API PlayerTaxi
|
||||
|
||||
bool IsTaximaskNodeKnown(uint32 nodeidx) const
|
||||
{
|
||||
uint32 field = uint32((nodeidx - 1) / 8);
|
||||
uint32 submask = 1 << ((nodeidx-1) % 8);
|
||||
return (m_taximask[field] & submask) == submask;
|
||||
uint32 field = uint32((nodeidx - 1) / (sizeof(TaxiMask::value_type) * 8));
|
||||
TaxiMask::value_type submask = TaxiMask::value_type(1 << ((nodeidx - 1) % (sizeof(TaxiMask::value_type) * 8)));
|
||||
return (m_taximask[field] & submask) != 0;
|
||||
}
|
||||
bool SetTaximaskNode(uint32 nodeidx)
|
||||
{
|
||||
uint32 field = uint32((nodeidx - 1) / 8);
|
||||
uint32 submask = 1 << ((nodeidx- 1) % 8);
|
||||
if ((m_taximask[field] & submask) != submask)
|
||||
uint32 field = uint32((nodeidx - 1) / (sizeof(TaxiMask::value_type) * 8));
|
||||
TaxiMask::value_type submask = TaxiMask::value_type(1 << ((nodeidx - 1) % (sizeof(TaxiMask::value_type) * 8)));
|
||||
if ((m_taximask[field] & submask) == 0)
|
||||
{
|
||||
m_taximask[field] |= submask;
|
||||
return true;
|
||||
|
||||
@@ -6734,8 +6734,8 @@ uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, ui
|
||||
if (!node || node->ContinentID != mapid || !isVisibleForFaction(node) || node->GetFlags().HasFlag(TaxiNodeFlags::IgnoreForFindNearest))
|
||||
continue;
|
||||
|
||||
uint32 field = uint32((node->ID - 1) / 8);
|
||||
uint32 submask = 1 << ((node->ID - 1) % 8);
|
||||
uint32 field = uint32((node->ID - 1) / (sizeof(TaxiMask::value_type) * 8));
|
||||
TaxiMask::value_type submask = TaxiMask::value_type(1 << ((node->ID - 1) % (sizeof(TaxiMask::value_type) * 8)));
|
||||
|
||||
// skip not taxi network nodes
|
||||
if ((sTaxiNodesMask[field] & submask) == 0)
|
||||
|
||||
@@ -561,13 +561,11 @@ void WorldSession::HandleBuyItemOpcode(WorldPackets::Item::BuyItem& packet)
|
||||
{
|
||||
case ITEM_VENDOR_TYPE_ITEM:
|
||||
{
|
||||
Item* bagItem = _player->GetItemByGuid(packet.ContainerGUID);
|
||||
|
||||
uint8 bag = NULL_BAG;
|
||||
if (bagItem && bagItem->IsBag())
|
||||
bag = bagItem->GetSlot();
|
||||
else if (packet.ContainerGUID == GetPlayer()->GetGUID()) // The client sends the player guid when trying to store an item in the default backpack
|
||||
if (packet.ContainerGUID == GetPlayer()->GetGUID()) // The client sends the player guid when trying to store an item in the default backpack
|
||||
bag = INVENTORY_SLOT_BAG_0;
|
||||
else if (Item* bagItem = _player->GetItemByGuid(packet.ContainerGUID))
|
||||
bag = bagItem->GetSlot();
|
||||
|
||||
GetPlayer()->BuyItemFromVendorSlot(packet.VendorGUID, packet.Muid, packet.Item.ItemID,
|
||||
packet.Quantity, bag, packet.Slot);
|
||||
|
||||
@@ -465,7 +465,7 @@ bool SpellEffectInfo::IsAura() const
|
||||
|
||||
bool SpellEffectInfo::IsAura(AuraType aura) const
|
||||
{
|
||||
return IsAura() && ApplyAuraName == uint32(aura);
|
||||
return IsAura() && ApplyAuraName == aura;
|
||||
}
|
||||
|
||||
bool SpellEffectInfo::IsTargetingArea() const
|
||||
|
||||
Reference in New Issue
Block a user