From 476f01dd8c91d5285904b7a74d4977880520b813 Mon Sep 17 00:00:00 2001 From: WinterSolstice8 <60417494+wintersolstice8@users.noreply.github.com> Date: Tue, 28 Apr 2026 18:51:51 -0600 Subject: [PATCH] [core] Skip sub slot if main is h2h with /lockstyleset # --- src/map/packets/c2s/0x053_lockstyle.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/map/packets/c2s/0x053_lockstyle.cpp b/src/map/packets/c2s/0x053_lockstyle.cpp index 8518b0cbae0..1cf1c1a9d81 100644 --- a/src/map/packets/c2s/0x053_lockstyle.cpp +++ b/src/map/packets/c2s/0x053_lockstyle.cpp @@ -49,6 +49,8 @@ auto GP_CLI_COMMAND_LOCKSTYLE::validate(MapSession* PSession, const CCharEntity* void GP_CLI_COMMAND_LOCKSTYLE::process(MapSession* PSession, CCharEntity* PChar) const { + bool hasH2HInMainSlot = false; + switch (static_cast(this->Mode)) { case GP_CLI_COMMAND_LOCKSTYLE_MODE::Disable: @@ -100,6 +102,17 @@ void GP_CLI_COMMAND_LOCKSTYLE::process(MapSession* PSession, CCharEntity* PChar) } PChar->styleItems[item.EquipKind] = itemId; + + if (i == SLOT_MAIN) + { + if (const CItemWeapon* PItemWeapon = dynamic_cast(PItem); PItemWeapon) + { + if (PItemWeapon->isHandToHand()) + { + hasH2HInMainSlot = true; + } + } + } } // Check if we need to remove conflicting slots. Essentially, packet injection shenanigan detector. @@ -126,8 +139,15 @@ void GP_CLI_COMMAND_LOCKSTYLE::process(MapSession* PSession, CCharEntity* PChar) switch (i) { - case SLOT_MAIN: case SLOT_SUB: + // Don't update the style of sub if main already assigned one (from being a h2h weapon) + if (hasH2HInMainSlot) + { + continue; + } + charutils::UpdateWeaponStyle(PChar, i, PItem); + break; + case SLOT_MAIN: case SLOT_RANGED: case SLOT_AMMO: charutils::UpdateWeaponStyle(PChar, i, PItem); @@ -139,6 +159,8 @@ void GP_CLI_COMMAND_LOCKSTYLE::process(MapSession* PSession, CCharEntity* PChar) case SLOT_FEET: charutils::UpdateArmorStyle(PChar, i); break; + default: + break; } }