From 0c10e845975a1fbf1dfbb5e6cb734359186bd28e Mon Sep 17 00:00:00 2001 From: Jeffrey Parks Date: Mon, 16 May 2022 21:50:34 -0500 Subject: [PATCH 1/4] Update logic checks everywhere for FVNoDropFlag. FVNoDropFlag == 0 is disabled FVNoDropFlag == 1 is enabled for everyone FVNoDropFlag == 2 is enabled for Admin() >= Character:MinStatusForNoDropExemptions --- world/client.cpp | 2 +- zone/inventory.cpp | 6 +++--- zone/trading.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/world/client.cpp b/world/client.cpp index 50689520c8..1b11134d12 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -156,7 +156,7 @@ void Client::SendLogServer() if(RuleB(World, IsGMPetitionWindowEnabled)) l->enable_petition_wnd = 1; - if((RuleI(World, FVNoDropFlag) == 1 || RuleI(World, FVNoDropFlag) == 2) && GetAdmin() > RuleI(Character, MinStatusForNoDropExemptions)) + if(RuleI(World, FVNoDropFlag) == 1 || (RuleI(World, FVNoDropFlag) == 2 && GetAdmin() >= RuleI(Character, MinStatusForNoDropExemptions))) l->enable_FV = 1; QueuePacket(outapp); diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 12b87ffabc..104d10c760 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -814,8 +814,8 @@ void Client::DropItem(int16 slot_id, bool recurse) LogInventory("[{}] (char_id: [{}]) Attempting to drop item from slot [{}] on the ground", GetCleanName(), CharacterID(), slot_id); - if(GetInv().CheckNoDrop(slot_id, recurse) && RuleI(World, FVNoDropFlag) == 0 || - RuleI(Character, MinStatusForNoDropExemptions) < Admin() && RuleI(World, FVNoDropFlag) == 2) + if(GetInv().CheckNoDrop(slot_id, recurse) && (RuleI(World, FVNoDropFlag) == 0 || + RuleI(Character, MinStatusForNoDropExemptions) < Admin() && RuleI(World, FVNoDropFlag) == 2)) { auto invalid_drop = m_inv.GetItem(slot_id); if (!invalid_drop) { @@ -1963,7 +1963,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if (((with && with->IsClient() && dst_slot_id >= EQ::invslot::TRADE_BEGIN && dst_slot_id <= EQ::invslot::TRADE_END) || (dst_slot_id >= EQ::invslot::SHARED_BANK_BEGIN && dst_slot_id <= EQ::invbag::SHARED_BANK_BAGS_END)) && GetInv().CheckNoDrop(src_slot_id) - && RuleI(World, FVNoDropFlag) == 0 || RuleI(Character, MinStatusForNoDropExemptions) < Admin() && RuleI(World, FVNoDropFlag) == 2) { + && (RuleI(World, FVNoDropFlag) == 0 || RuleI(Character, MinStatusForNoDropExemptions) < Admin() && RuleI(World, FVNoDropFlag) == 2)) { auto ndh_inst = m_inv[src_slot_id]; std::string ndh_item_data; if (ndh_inst == nullptr) { diff --git a/zone/trading.cpp b/zone/trading.cpp index 741c6b8888..29f174d8ed 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -499,7 +499,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st LogTrading("Giving container [{}] ([{}]) in slot [{}] to [{}]", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); // TODO: need to check bag items/augments for no drop..everything for attuned... - if (inst->GetItem()->NoDrop != 0 || Admin() >= RuleI(Character, MinStatusForNoDropExemptions) || RuleI(World, FVNoDropFlag) == 1 || other == this) { + if (inst->GetItem()->NoDrop != 0 || RuleI(World, FVNoDropFlag) == 1 || (RuleI(World, FVNoDropFlag) == 2 && Admin() >= RuleI(Character, MinStatusForNoDropExemptions))|| other == this) { int16 free_slot = other->GetInv().FindFreeSlotForTradeItem(inst); if (free_slot != INVALID_INDEX) { @@ -717,7 +717,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st LogTrading("Giving item [{}] ([{}]) in slot [{}] to [{}]", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); // TODO: need to check bag items/augments for no drop..everything for attuned... - if (inst->GetItem()->NoDrop != 0 || Admin() >= RuleI(Character, MinStatusForNoDropExemptions) || RuleI(World, FVNoDropFlag) == 1 || other == this) { + if (inst->GetItem()->NoDrop != 0 || RuleI(World, FVNoDropFlag) == 1 || (RuleI(World, FVNoDropFlag) == 2 && Admin() >= RuleI(Character, MinStatusForNoDropExemptions)) || other == this) { int16 free_slot = other->GetInv().FindFreeSlotForTradeItem(inst); if (free_slot != INVALID_INDEX) { From 484dddf94b383f7d47b26aab951552b8f917e6d4 Mon Sep 17 00:00:00 2001 From: Jeffrey Parks Date: Fri, 20 May 2022 11:46:56 -0500 Subject: [PATCH 2/4] Adding extra parenthesis to reduce ambiquity of order of operations for FVNoDropFlag checks --- zone/inventory.cpp | 4 ++-- zone/trading.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 104d10c760..96d141ab65 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -815,7 +815,7 @@ void Client::DropItem(int16 slot_id, bool recurse) GetCleanName(), CharacterID(), slot_id); if(GetInv().CheckNoDrop(slot_id, recurse) && (RuleI(World, FVNoDropFlag) == 0 || - RuleI(Character, MinStatusForNoDropExemptions) < Admin() && RuleI(World, FVNoDropFlag) == 2)) + (RuleI(Character, MinStatusForNoDropExemptions) < Admin() && RuleI(World, FVNoDropFlag) == 2))) { auto invalid_drop = m_inv.GetItem(slot_id); if (!invalid_drop) { @@ -1963,7 +1963,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if (((with && with->IsClient() && dst_slot_id >= EQ::invslot::TRADE_BEGIN && dst_slot_id <= EQ::invslot::TRADE_END) || (dst_slot_id >= EQ::invslot::SHARED_BANK_BEGIN && dst_slot_id <= EQ::invbag::SHARED_BANK_BAGS_END)) && GetInv().CheckNoDrop(src_slot_id) - && (RuleI(World, FVNoDropFlag) == 0 || RuleI(Character, MinStatusForNoDropExemptions) < Admin() && RuleI(World, FVNoDropFlag) == 2)) { + && (RuleI(World, FVNoDropFlag) == 0 || (RuleI(Character, MinStatusForNoDropExemptions) < Admin() && RuleI(World, FVNoDropFlag) == 2))) { auto ndh_inst = m_inv[src_slot_id]; std::string ndh_item_data; if (ndh_inst == nullptr) { diff --git a/zone/trading.cpp b/zone/trading.cpp index 29f174d8ed..7efffb93f0 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -499,7 +499,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st LogTrading("Giving container [{}] ([{}]) in slot [{}] to [{}]", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); // TODO: need to check bag items/augments for no drop..everything for attuned... - if (inst->GetItem()->NoDrop != 0 || RuleI(World, FVNoDropFlag) == 1 || (RuleI(World, FVNoDropFlag) == 2 && Admin() >= RuleI(Character, MinStatusForNoDropExemptions))|| other == this) { + if (inst->GetItem()->NoDrop != 0 || RuleI(World, FVNoDropFlag) == 1 || (RuleI(World, FVNoDropFlag) == 2 && Admin() >= RuleI(Character, MinStatusForNoDropExemptions)) || other == this) { int16 free_slot = other->GetInv().FindFreeSlotForTradeItem(inst); if (free_slot != INVALID_INDEX) { From 22e1273f9c137ef2cd7325bfdf933b44407bf674 Mon Sep 17 00:00:00 2001 From: Jeffrey Parks Date: Sat, 16 Jul 2022 09:16:45 -0500 Subject: [PATCH 3/4] Move FVNoDropFlag checks into a helper function in emu_constants.cpp and make an enum for the possible values. Added console warning if setting is outside of allowed values. --- common/emu_constants.cpp | 21 +++++++++++++++++++-- common/emu_constants.h | 2 ++ common/eq_constants.h | 7 +++++++ world/client.cpp | 2 +- zone/inventory.cpp | 5 ++--- zone/trading.cpp | 4 ++-- 6 files changed, 33 insertions(+), 8 deletions(-) diff --git a/common/emu_constants.cpp b/common/emu_constants.cpp index ad720123cc..5bc1bc6501 100644 --- a/common/emu_constants.cpp +++ b/common/emu_constants.cpp @@ -18,9 +18,12 @@ */ #include "emu_constants.h" -#include "languages.h" -#include "data_verification.h" #include "bodytypes.h" +#include "data_verification.h" +#include "eqemu_logsys.h" +#include "eqemu_logsys_log_aliases.h" +#include "languages.h" +#include "rulesys.h" int16 EQ::invtype::GetInvTypeSize(int16 inv_type) { static const int16 local_array[] = { @@ -432,3 +435,17 @@ std::string EQ::constants::GetSpawnAnimationName(uint8 animation_id) return std::string(); } + +bool EQ::inventory::CanTradeNoDropItem(const int16 admin_status) +{ + const int no_drop_flag = RuleI(World, FVNoDropFlag); + const int no_drop_min_admin_status = RuleI(Character, MinStatusForNoDropExemptions); + switch (no_drop_flag) { + case FVNoDropFlagRule::Disabled: return false; + case FVNoDropFlagRule::Enabled: return true; + case FVNoDropFlagRule::AdminOnly: return admin_status >= no_drop_min_admin_status; + default: + LogWarning("Invalid value {0} set for FVNoDropFlag", no_drop_flag); + return false; + } +} diff --git a/common/emu_constants.h b/common/emu_constants.h index 9413933166..8df81cb8cf 100644 --- a/common/emu_constants.h +++ b/common/emu_constants.h @@ -34,6 +34,8 @@ namespace EQ using RoF2::INULL; namespace inventory { + + bool CanTradeNoDropItem(int16 admin_status); } /*inventory*/ diff --git a/common/eq_constants.h b/common/eq_constants.h index 8949ea1099..4f3c89f7a9 100644 --- a/common/eq_constants.h +++ b/common/eq_constants.h @@ -1009,4 +1009,11 @@ enum StartZoneIndex { SharVahl }; +enum FVNoDropFlagRule +{ + Disabled = 0, + Enabled = 1, + AdminOnly = 2 +}; + #endif /*COMMON_EQ_CONSTANTS_H*/ diff --git a/world/client.cpp b/world/client.cpp index 07ad7aa3b7..58cfc80d4e 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -156,7 +156,7 @@ void Client::SendLogServer() if(RuleB(World, IsGMPetitionWindowEnabled)) l->enable_petition_wnd = 1; - if(RuleI(World, FVNoDropFlag) == 1 || (RuleI(World, FVNoDropFlag) == 2 && GetAdmin() >= RuleI(Character, MinStatusForNoDropExemptions))) + if(EQ::inventory::CanTradeNoDropItem(GetAdmin())) l->enable_FV = 1; QueuePacket(outapp); diff --git a/zone/inventory.cpp b/zone/inventory.cpp index eb8f6c871f..5bf229b7cc 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -814,8 +814,7 @@ void Client::DropItem(int16 slot_id, bool recurse) LogInventory("[{}] (char_id: [{}]) Attempting to drop item from slot [{}] on the ground", GetCleanName(), CharacterID(), slot_id); - if(GetInv().CheckNoDrop(slot_id, recurse) && (RuleI(World, FVNoDropFlag) == 0 || - (RuleI(Character, MinStatusForNoDropExemptions) < Admin() && RuleI(World, FVNoDropFlag) == 2))) + if(GetInv().CheckNoDrop(slot_id, recurse) && !EQ::inventory::CanTradeNoDropItem(Admin())) { auto invalid_drop = m_inv.GetItem(slot_id); if (!invalid_drop) { @@ -1963,7 +1962,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if (((with && with->IsClient() && dst_slot_id >= EQ::invslot::TRADE_BEGIN && dst_slot_id <= EQ::invslot::TRADE_END) || (dst_slot_id >= EQ::invslot::SHARED_BANK_BEGIN && dst_slot_id <= EQ::invbag::SHARED_BANK_BAGS_END)) && GetInv().CheckNoDrop(src_slot_id) - && (RuleI(World, FVNoDropFlag) == 0 || (RuleI(Character, MinStatusForNoDropExemptions) < Admin() && RuleI(World, FVNoDropFlag) == 2))) { + && !EQ::inventory::CanTradeNoDropItem(Admin())) { auto ndh_inst = m_inv[src_slot_id]; std::string ndh_item_data; if (ndh_inst == nullptr) { diff --git a/zone/trading.cpp b/zone/trading.cpp index b5381bd7f9..5a7680956e 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -499,7 +499,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st LogTrading("Giving container [{}] ([{}]) in slot [{}] to [{}]", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); // TODO: need to check bag items/augments for no drop..everything for attuned... - if (inst->GetItem()->NoDrop != 0 || RuleI(World, FVNoDropFlag) == 1 || (RuleI(World, FVNoDropFlag) == 2 && Admin() >= RuleI(Character, MinStatusForNoDropExemptions)) || other == this) { + if (inst->GetItem()->NoDrop != 0 || EQ::inventory::CanTradeNoDropItem(Admin()) || other == this) { int16 free_slot = other->GetInv().FindFreeSlotForTradeItem(inst); if (free_slot != INVALID_INDEX) { @@ -717,7 +717,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st LogTrading("Giving item [{}] ([{}]) in slot [{}] to [{}]", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); // TODO: need to check bag items/augments for no drop..everything for attuned... - if (inst->GetItem()->NoDrop != 0 || RuleI(World, FVNoDropFlag) == 1 || (RuleI(World, FVNoDropFlag) == 2 && Admin() >= RuleI(Character, MinStatusForNoDropExemptions)) || other == this) { + if (inst->GetItem()->NoDrop != 0 || EQ::inventory::CanTradeNoDropItem(Admin()) || other == this) { int16 free_slot = other->GetInv().FindFreeSlotForTradeItem(inst); if (free_slot != INVALID_INDEX) { From e22cae1404a5abd18885bc02827e5650aafda747 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 30 Jul 2022 12:58:14 -0500 Subject: [PATCH 4/4] Move to client scoped helper method --- common/emu_constants.cpp | 22 ++++------------------ common/emu_constants.h | 14 ++++---------- world/client.cpp | 22 +++++++++++++++++++++- world/client.h | 1 + zone/client.h | 3 ++- zone/client_packet.cpp | 20 ++++++++++++++++++++ zone/inventory.cpp | 4 ++-- zone/trading.cpp | 5 +++-- 8 files changed, 57 insertions(+), 34 deletions(-) diff --git a/common/emu_constants.cpp b/common/emu_constants.cpp index 5bc1bc6501..9b8fb9076e 100644 --- a/common/emu_constants.cpp +++ b/common/emu_constants.cpp @@ -1,5 +1,5 @@ /* EQEMu: Everquest Server Emulator - + Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net) This program is free software; you can redistribute it and/or modify @@ -120,7 +120,7 @@ EQ::bug::CategoryID EQ::bug::CategoryNameToCategoryID(const char* category_name) return catLoNTCG; if (!strcmp(category_name, "Mercenaries")) return catMercenaries; - + return catOther; } @@ -224,7 +224,7 @@ std::string EQ::constants::GetLDoNThemeName(uint32 theme_id) return EQ::constants::GetLDoNThemeMap().find(theme_id)->second; } - return std::string(); + return std::string(); } const std::map& EQ::constants::GetFlyModeMap() @@ -324,7 +324,7 @@ const std::map& EQ::constants::GetAccountStatusMap() { AccountStatus::GMAreas, "GM Areas" }, { AccountStatus::GMCoder, "GM Coder" }, { AccountStatus::GMMgmt, "GM Mgmt" }, - { AccountStatus::GMImpossible, "GM Impossible" }, + { AccountStatus::GMImpossible, "GM Impossible" }, { AccountStatus::Max, "GM Max" } }; @@ -435,17 +435,3 @@ std::string EQ::constants::GetSpawnAnimationName(uint8 animation_id) return std::string(); } - -bool EQ::inventory::CanTradeNoDropItem(const int16 admin_status) -{ - const int no_drop_flag = RuleI(World, FVNoDropFlag); - const int no_drop_min_admin_status = RuleI(Character, MinStatusForNoDropExemptions); - switch (no_drop_flag) { - case FVNoDropFlagRule::Disabled: return false; - case FVNoDropFlagRule::Enabled: return true; - case FVNoDropFlagRule::AdminOnly: return admin_status >= no_drop_min_admin_status; - default: - LogWarning("Invalid value {0} set for FVNoDropFlag", no_drop_flag); - return false; - } -} diff --git a/common/emu_constants.h b/common/emu_constants.h index 8df81cb8cf..ba4aaedc57 100644 --- a/common/emu_constants.h +++ b/common/emu_constants.h @@ -1,5 +1,5 @@ /* EQEMu: Everquest Server Emulator - + Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net) This program is free software; you can redistribute it and/or modify @@ -32,12 +32,6 @@ namespace EQ { using RoF2::IINVALID; using RoF2::INULL; - - namespace inventory { - - bool CanTradeNoDropItem(int16 admin_status); - - } /*inventory*/ namespace invtype { using namespace RoF2::invtype::enum_; @@ -203,7 +197,7 @@ namespace EQ using RoF2::constants::EXPANSIONS_MASK; using RoF2::constants::CHARACTER_CREATION_LIMIT; - + const size_t SAY_LINK_OPENER_SIZE = 1; using RoF2::constants::SAY_LINK_BODY_SIZE; const size_t SAY_LINK_TEXT_SIZE = 256; // this may be varied until it breaks something (tested:374) - the others are constant @@ -262,7 +256,7 @@ namespace EQ extern const std::map& GetLDoNThemeMap(); std::string GetLDoNThemeName(uint32 theme_id); - + extern const std::map& GetFlyModeMap(); std::string GetFlyModeName(int8 flymode_id); @@ -293,7 +287,7 @@ namespace EQ namespace profile { using RoF2::profile::BANDOLIERS_SIZE; using RoF2::profile::BANDOLIER_ITEM_COUNT; - + using RoF2::profile::POTION_BELT_SIZE; using RoF2::profile::SKILL_ARRAY_SIZE; diff --git a/world/client.cpp b/world/client.cpp index 58cfc80d4e..fc9aa73af1 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -156,13 +156,33 @@ void Client::SendLogServer() if(RuleB(World, IsGMPetitionWindowEnabled)) l->enable_petition_wnd = 1; - if(EQ::inventory::CanTradeNoDropItem(GetAdmin())) + if (CanTradeFVNoDropItem()) { l->enable_FV = 1; + } QueuePacket(outapp); safe_delete(outapp); } +bool Client::CanTradeFVNoDropItem() +{ + const int16 admin_status = GetAdmin(); + const int no_drop_flag = RuleI(World, FVNoDropFlag); + const int no_drop_min_admin_status = RuleI(Character, MinStatusForNoDropExemptions); + switch (no_drop_flag) { + case FVNoDropFlagRule::Disabled: + return false; + case FVNoDropFlagRule::Enabled: + return true; + case FVNoDropFlagRule::AdminOnly: + return admin_status >= no_drop_min_admin_status; + default: + LogWarning("Invalid value {0} set for FVNoDropFlag", no_drop_flag); + return false; + } + return false; +} + void Client::SendEnterWorld(std::string name) { char char_name[64] = { 0 }; diff --git a/world/client.h b/world/client.h index 76f14e6c1e..93aacb31db 100644 --- a/world/client.h +++ b/world/client.h @@ -120,6 +120,7 @@ class Client { bool ChecksumVerificationCRCBaseData(uint64 checksum); EQStreamInterface* eqs; + bool CanTradeFVNoDropItem(); }; bool CheckCharCreateInfoSoF(CharCreate_Struct *cc); diff --git a/zone/client.h b/zone/client.h index bb7bbd54b1..62adb71eed 100644 --- a/zone/client.h +++ b/zone/client.h @@ -409,7 +409,7 @@ class Client : public Mob inline void SetBaseRace(uint32 i) { m_pp.race=i; } inline void SetBaseGender(uint32 i) { m_pp.gender=i; } inline void SetDeity(uint32 i) {m_pp.deity=i;deity=i;} - + void SetTrackingID(uint32 entity_id); inline uint8 GetLevel2() const { return m_pp.level2; } @@ -2051,6 +2051,7 @@ class Client : public Mob bool m_bot_precombat; #endif + bool CanTradeFVNoDropItem(); }; #endif diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index ef345980c9..2e888797dd 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -15561,3 +15561,23 @@ void Client::SetSharedTaskId(int64 shared_task_id) { Client::m_shared_task_id = shared_task_id; } + +bool Client::CanTradeFVNoDropItem() +{ + const int16 admin_status = Admin(); + const int no_drop_flag = RuleI(World, FVNoDropFlag); + const int no_drop_min_admin_status = RuleI(Character, MinStatusForNoDropExemptions); + switch (no_drop_flag) { + case FVNoDropFlagRule::Disabled: + return false; + case FVNoDropFlagRule::Enabled: + return true; + case FVNoDropFlagRule::AdminOnly: + return admin_status >= no_drop_min_admin_status; + default: + LogWarning("Invalid value {0} set for FVNoDropFlag", no_drop_flag); + return false; + } + + return false; +} diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 5bf229b7cc..055b3931cf 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -814,7 +814,7 @@ void Client::DropItem(int16 slot_id, bool recurse) LogInventory("[{}] (char_id: [{}]) Attempting to drop item from slot [{}] on the ground", GetCleanName(), CharacterID(), slot_id); - if(GetInv().CheckNoDrop(slot_id, recurse) && !EQ::inventory::CanTradeNoDropItem(Admin())) + if(GetInv().CheckNoDrop(slot_id, recurse) && !CanTradeFVNoDropItem()) { auto invalid_drop = m_inv.GetItem(slot_id); if (!invalid_drop) { @@ -1962,7 +1962,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if (((with && with->IsClient() && dst_slot_id >= EQ::invslot::TRADE_BEGIN && dst_slot_id <= EQ::invslot::TRADE_END) || (dst_slot_id >= EQ::invslot::SHARED_BANK_BEGIN && dst_slot_id <= EQ::invbag::SHARED_BANK_BAGS_END)) && GetInv().CheckNoDrop(src_slot_id) - && !EQ::inventory::CanTradeNoDropItem(Admin())) { + && !CanTradeFVNoDropItem()) { auto ndh_inst = m_inv[src_slot_id]; std::string ndh_item_data; if (ndh_inst == nullptr) { diff --git a/zone/trading.cpp b/zone/trading.cpp index 5a7680956e..7a78faf676 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -499,7 +499,8 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st LogTrading("Giving container [{}] ([{}]) in slot [{}] to [{}]", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); // TODO: need to check bag items/augments for no drop..everything for attuned... - if (inst->GetItem()->NoDrop != 0 || EQ::inventory::CanTradeNoDropItem(Admin()) || other == this) { + if (inst->GetItem()->NoDrop != 0 || + CanTradeFVNoDropItem() && CanTradeFVNoDropItem() || other == this) { int16 free_slot = other->GetInv().FindFreeSlotForTradeItem(inst); if (free_slot != INVALID_INDEX) { @@ -717,7 +718,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st LogTrading("Giving item [{}] ([{}]) in slot [{}] to [{}]", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); // TODO: need to check bag items/augments for no drop..everything for attuned... - if (inst->GetItem()->NoDrop != 0 || EQ::inventory::CanTradeNoDropItem(Admin()) || other == this) { + if (inst->GetItem()->NoDrop != 0 || CanTradeFVNoDropItem() || other == this) { int16 free_slot = other->GetInv().FindFreeSlotForTradeItem(inst); if (free_slot != INVALID_INDEX) {