mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
[Rules] Update logic checks everywhere for FVNoDropFlag. (#2179)
* Update logic checks everywhere for FVNoDropFlag. FVNoDropFlag == 0 is disabled FVNoDropFlag == 1 is enabled for everyone FVNoDropFlag == 2 is enabled for Admin() >= Character:MinStatusForNoDropExemptions * Adding extra parenthesis to reduce ambiquity of order of operations for FVNoDropFlag checks * 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. * Move to client scoped helper method Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
+2
-3
@@ -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) && !CanTradeFVNoDropItem())
|
||||
{
|
||||
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) {
|
||||
&& !CanTradeFVNoDropItem()) {
|
||||
auto ndh_inst = m_inv[src_slot_id];
|
||||
std::string ndh_item_data;
|
||||
if (ndh_inst == nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user