From 4adcaa7beeefbc11b0234f9f139e849da5fcdb0b Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Mon, 24 Jun 2024 00:00:48 -0700 Subject: [PATCH] skip max grind check on v3 --- src/Items.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Items.cc b/src/Items.cc index 9fafeb74..35a0293e 100644 --- a/src/Items.cc +++ b/src/Items.cc @@ -12,7 +12,8 @@ void player_use_item(shared_ptr c, size_t item_index, shared_ptrversion()) || is_v4(c->version()); + bool is_v4 = ::is_v4(c->version()); + bool is_v3_or_later = is_v3(c->version()) || is_v4; bool should_delete_item = is_v3_or_later; auto player = c->character(); @@ -36,13 +37,9 @@ void player_use_item(shared_ptr c, size_t item_index, shared_ptrinventory.items[player->inventory.find_equipped_item(EquipSlot::WEAPON)]; - // Don't enforce the weapon's grind limit on V1 and V2. This is necessary - // because the V2 client replaces its inventory items on the fly with items - // compatible with V1 when sending the 61 and 98 commands. There appears to - // be no way to disable this behavior, so there's no way for the server to - // get an accurate picture of what's actually in the player's inventory, so - // there's no way to know if we would be enforcing the correct grind limit. - if (is_v3_or_later) { + // Only enforce grind limits on BB, since the server doesn't have direct + // control over players' inventories on other versions + if (is_v4) { auto item_parameter_table = s->item_parameter_table(c->version()); auto weapon_def = item_parameter_table->get_weapon(weapon.data.data1[1], weapon.data.data1[2]); if (weapon.data.data1[3] >= weapon_def.max_grind) {