mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Misc: Renamed some misnamed flags that were referencing to item-sparse flags instead of the item_fields ones
This commit is contained in:
@@ -760,7 +760,7 @@ bool Item::CanBeTraded(bool mail, bool trade) const
|
||||
if (m_lootGenerated)
|
||||
return false;
|
||||
|
||||
if ((!mail || !IsBoundAccountWide()) && (IsSoulBound() && (!HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE) || !trade)))
|
||||
if ((!mail || !IsBoundAccountWide()) && (IsSoulBound() && (!HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE) || !trade)))
|
||||
return false;
|
||||
|
||||
if (IsBag() && (Player::IsBagPos(GetPos()) || !((Bag const*)this)->IsEmpty()))
|
||||
@@ -1071,7 +1071,7 @@ Item* Item::CloneItem(uint32 count, Player const* player) const
|
||||
|
||||
newItem->SetGuidValue(ITEM_FIELD_CREATOR, GetGuidValue(ITEM_FIELD_CREATOR));
|
||||
newItem->SetGuidValue(ITEM_FIELD_GIFTCREATOR, GetGuidValue(ITEM_FIELD_GIFTCREATOR));
|
||||
newItem->SetUInt32Value(ITEM_FIELD_FLAGS, GetUInt32Value(ITEM_FIELD_FLAGS) & ~(ITEM_FLAG_REFUNDABLE | ITEM_FLAG_BOP_TRADEABLE));
|
||||
newItem->SetUInt32Value(ITEM_FIELD_FLAGS, GetUInt32Value(ITEM_FIELD_FLAGS) & ~(ITEM_FIELD_FLAG_REFUNDABLE | ITEM_FIELD_FLAG_BOP_TRADEABLE));
|
||||
newItem->SetUInt32Value(ITEM_FIELD_DURATION, GetUInt32Value(ITEM_FIELD_DURATION));
|
||||
// player CAN be NULL in which case we must not update random properties because that accesses player's item update queue
|
||||
if (player)
|
||||
@@ -1089,7 +1089,7 @@ bool Item::IsBindedNotWith(Player const* player) const
|
||||
if (GetOwnerGUID() == player->GetGUID())
|
||||
return false;
|
||||
|
||||
if (HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE))
|
||||
if (HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE))
|
||||
if (allowedGUIDs.find(player->GetGUID()) != allowedGUIDs.end())
|
||||
return false;
|
||||
|
||||
@@ -1211,10 +1211,10 @@ void Item::DeleteRefundDataFromDB(SQLTransaction* trans)
|
||||
|
||||
void Item::SetNotRefundable(Player* owner, bool changestate /*=true*/, SQLTransaction* trans /*=NULL*/)
|
||||
{
|
||||
if (!HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE))
|
||||
if (!HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE))
|
||||
return;
|
||||
|
||||
RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE);
|
||||
RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE);
|
||||
// Following is not applicable in the trading procedure
|
||||
if (changestate)
|
||||
SetState(ITEM_CHANGED, owner);
|
||||
@@ -1269,13 +1269,13 @@ bool Item::IsRefundExpired()
|
||||
|
||||
void Item::SetSoulboundTradeable(GuidSet const& allowedLooters)
|
||||
{
|
||||
SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE);
|
||||
SetFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE);
|
||||
allowedGUIDs = allowedLooters;
|
||||
}
|
||||
|
||||
void Item::ClearSoulboundTradeable(Player* currentOwner)
|
||||
{
|
||||
RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE);
|
||||
RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE);
|
||||
if (allowedGUIDs.empty())
|
||||
return;
|
||||
|
||||
|
||||
@@ -12010,7 +12010,7 @@ void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool
|
||||
// in case trade we already have item in other player inventory
|
||||
pLastItem->SetState(in_characterInventoryDB ? ITEM_CHANGED : ITEM_NEW, this);
|
||||
|
||||
if (pLastItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE))
|
||||
if (pLastItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE))
|
||||
AddTradeableItem(pLastItem);
|
||||
}
|
||||
}
|
||||
@@ -17779,7 +17779,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
|
||||
GetGUID().ToString().c_str(), GetName().c_str(), timeDiff, item->GetGUID().ToString().c_str(), item->GetEntry());
|
||||
remove = true;
|
||||
}
|
||||
else if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE))
|
||||
else if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE))
|
||||
{
|
||||
if (item->GetPlayedTime() > (2 * HOUR))
|
||||
{
|
||||
@@ -17790,7 +17790,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
|
||||
stmt->setUInt64(0, item->GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE);
|
||||
item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -17808,11 +17808,11 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
|
||||
{
|
||||
TC_LOG_DEBUG("entities.player.loading", "Player::_LoadInventory: player (%s, name: '%s') has item (%s, entry: %u) with refundable flags, but without data in item_refund_instance. Removing flag.",
|
||||
GetGUID().ToString().c_str(), GetName().c_str(), item->GetGUID().ToString().c_str(), item->GetEntry());
|
||||
item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE);
|
||||
item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE))
|
||||
else if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE))
|
||||
{
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEM_BOP_TRADE);
|
||||
stmt->setUInt64(0, item->GetGUID().GetCounter());
|
||||
@@ -17834,9 +17834,9 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
|
||||
}
|
||||
else
|
||||
{
|
||||
TC_LOG_DEBUG("entities.player.loading", "Player::_LoadInventory: player (%s, name: '%s') has item (%s, entry: %u) with ITEM_FLAG_BOP_TRADEABLE flag, but without data in item_soulbound_trade_data. Removing flag.",
|
||||
TC_LOG_DEBUG("entities.player.loading", "Player::_LoadInventory: player (%s, name: '%s') has item (%s, entry: %u) with ITEM_FIELD_FLAG_BOP_TRADEABLE flag, but without data in item_soulbound_trade_data. Removing flag.",
|
||||
GetGUID().ToString().c_str(), GetName().c_str(), item->GetGUID().ToString().c_str(), item->GetEntry());
|
||||
item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE);
|
||||
item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE);
|
||||
}
|
||||
}
|
||||
else if (proto->GetHolidayID())
|
||||
@@ -21209,7 +21209,7 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c
|
||||
|
||||
if (pProto->GetFlags() & ITEM_FLAG_REFUNDABLE && crItem->ExtendedCost && pProto->GetMaxStackSize() == 1)
|
||||
{
|
||||
it->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE);
|
||||
it->SetFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE);
|
||||
it->SetRefundRecipient(GetGUID());
|
||||
it->SetPaidMoney(price);
|
||||
it->SetPaidExtendedCost(crItem->ExtendedCost);
|
||||
@@ -25668,10 +25668,10 @@ void Player::DeleteRefundReference(ObjectGuid it)
|
||||
|
||||
void Player::SendRefundInfo(Item* item)
|
||||
{
|
||||
// This function call unsets ITEM_FLAGS_REFUNDABLE if played time is over 2 hours.
|
||||
// This function call unsets ITEM_FIELD_FLAG_REFUNDABLE if played time is over 2 hours.
|
||||
item->UpdatePlayedTime(this);
|
||||
|
||||
if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE))
|
||||
if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE))
|
||||
{
|
||||
TC_LOG_DEBUG("entities.player.items", "Item refund: item not refundable!");
|
||||
return;
|
||||
@@ -25819,7 +25819,7 @@ void Player::SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece,
|
||||
|
||||
void Player::RefundItem(Item* item)
|
||||
{
|
||||
if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE))
|
||||
if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE))
|
||||
{
|
||||
TC_LOG_DEBUG("entities.player.items", "Item refund: item not refundable!");
|
||||
return;
|
||||
|
||||
@@ -388,7 +388,7 @@ void WorldSession::HandleSellItemOpcode(WorldPackets::Item::SellItem& packet)
|
||||
// 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_FLAG_REFUNDABLE))
|
||||
if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE))
|
||||
return; // Therefore, no feedback to client
|
||||
|
||||
// special case at auto sell (sell all)
|
||||
|
||||
@@ -124,7 +124,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
|
||||
}
|
||||
|
||||
// adjust time (depends on /played)
|
||||
if (myItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE))
|
||||
if (myItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE))
|
||||
myItems[i]->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, trader->GetTotalPlayedTime()-(_player->GetTotalPlayedTime()-myItems[i]->GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME)));
|
||||
// store
|
||||
trader->MoveItemToInventory(traderDst, myItems[i], true, true);
|
||||
@@ -142,7 +142,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
|
||||
}
|
||||
|
||||
// adjust time (depends on /played)
|
||||
if (hisItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE))
|
||||
if (hisItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE))
|
||||
hisItems[i]->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, _player->GetTotalPlayedTime()-(trader->GetTotalPlayedTime()-hisItems[i]->GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME)));
|
||||
// store
|
||||
_player->MoveItemToInventory(playerDst, hisItems[i], true, true);
|
||||
|
||||
Reference in New Issue
Block a user