summaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/ItemHandler.cpp
diff options
context:
space:
mode:
authorKitzunu <24550914+Kitzunu@users.noreply.github.com>2024-09-01 00:38:50 +0200
committerGitHub <noreply@github.com>2024-08-31 19:38:50 -0300
commit5d31b9f98ff9b44598c60f4944a3fd98e79c9cbf (patch)
treee7b380df45bdcb70adf595479ac04000cfff8c00 /src/server/game/Handlers/ItemHandler.cpp
parentf88812443d8e2f0057416e70d8e4c474e3ca79cb (diff)
refactor(Core/Item): Add helpers (#19828)
Diffstat (limited to 'src/server/game/Handlers/ItemHandler.cpp')
-rw-r--r--src/server/game/Handlers/ItemHandler.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp
index afe228b4e1..0623001e85 100644
--- a/src/server/game/Handlers/ItemHandler.cpp
+++ b/src/server/game/Handlers/ItemHandler.cpp
@@ -319,7 +319,7 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket& recvData)
return;
}
- if (pItem->GetTemplate()->Flags & ITEM_FLAG_NO_USER_DESTROY)
+ if (pItem->GetTemplate()->HasFlag(ITEM_FLAG_NO_USER_DESTROY))
{
_player->SendEquipError(EQUIP_ERR_CANT_DROP_SOULBOUND, nullptr, nullptr);
return;
@@ -783,7 +783,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket& recvData)
// prevent selling item for sellprice when the item is still refundable
// this probably happens when right clicking a refundable item, the client sends both
// CMSG_SELL_ITEM and CMSG_REFUND_ITEM (unverified)
- if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE))
+ if (pItem->IsRefundable())
return; // Therefore, no feedback to client
// special case at auto sell (sell all)
@@ -1091,7 +1091,7 @@ void WorldSession::SendListInventory(ObjectGuid vendorGuid, uint32 vendorEntry)
}
// Only display items in vendor lists for the team the
// player is on. If GM on, display all items.
- if (!_player->IsGameMaster() && ((itemTemplate->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY && _player->GetTeamId() == TEAM_ALLIANCE) || (itemTemplate->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY && _player->GetTeamId() == TEAM_HORDE)))
+ if (!_player->IsGameMaster() && ((itemTemplate->HasFlag2(ITEM_FLAG2_FACTION_HORDE) && _player->GetTeamId() == TEAM_ALLIANCE) || (itemTemplate->HasFlag2(ITEM_FLAG2_FACTION_ALLIANCE) && _player->GetTeamId() == TEAM_HORDE)))
{
continue;
}
@@ -1282,7 +1282,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData)
return;
}
- if (!(gift->GetTemplate()->Flags & ITEM_FLAG_IS_WRAPPER)) // cheating: non-wrapper wrapper
+ if (!(gift->GetTemplate()->HasFlag(ITEM_FLAG_IS_WRAPPER))) // cheating: non-wrapper wrapper
{
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, gift, nullptr);
return;
@@ -1483,7 +1483,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData)
ItemTemplate const* iGemProto = Gems[i]->GetTemplate();
// unique item (for new and already placed bit removed enchantments
- if (iGemProto->Flags & ITEM_FLAG_UNIQUE_EQUIPPABLE)
+ if (iGemProto->HasFlag(ITEM_FLAG_UNIQUE_EQUIPPABLE))
{
for (int j = 0; j < MAX_GEM_SOCKETS; ++j)
{