Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rules] Update logic checks everywhere for FVNoDropFlag. #2179

Merged
merged 8 commits into from
Jul 30, 2022
2 changes: 1 addition & 1 deletion world/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Kinglykrab marked this conversation as resolved.
Show resolved Hide resolved
Akkadius marked this conversation as resolved.
Show resolved Hide resolved
l->enable_FV = 1;

QueuePacket(outapp);
Expand Down
6 changes: 3 additions & 3 deletions zone/inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Kinglykrab marked this conversation as resolved.
Show resolved Hide resolved
{
auto invalid_drop = m_inv.GetItem(slot_id);
if (!invalid_drop) {
Expand Down Expand Up @@ -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)) {
Kinglykrab marked this conversation as resolved.
Show resolved Hide resolved
auto ndh_inst = m_inv[src_slot_id];
std::string ndh_item_data;
if (ndh_inst == nullptr) {
Expand Down
4 changes: 2 additions & 2 deletions zone/trading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Kinglykrab marked this conversation as resolved.
Show resolved Hide resolved
int16 free_slot = other->GetInv().FindFreeSlotForTradeItem(inst);

if (free_slot != INVALID_INDEX) {
Expand Down