Skip to content

[Warrior] Allow auto attacks without a main hand weapon - #75

Closed
kflirik wants to merge 1 commit into
simulationcraft:mainfrom
kflirik:warrior-unarmed
Closed

kflirik wants to merge 1 commit into
simulationcraft:mainfrom
kflirik:warrior-unarmed

Conversation

@kflirik

@kflirik kflirik commented Nov 13, 2026

Copy link
Copy Markdown

A warrior profile without a main hand weapon aborts in debug builds:

sc_warrior.cpp:232: warrior_auto_attack_t::warrior_auto_attack_t(warrior_t *, util::string_view):
Assertion `p->equipped_weapons[ SLOT_MAIN_HAND ].type != WEAPON_NONE' failed.

Reproduce with a profile that is just warrior="T", level=31, race=dwarf. Release builds run it, but the unarmed swing has no base damage.

Change

warrior_auto_attack_t no longer asserts. An empty main hand is treated as an unarmed weapon: 2.0 swing time (the weapon_t default) and 1 base damage.

Verification

In game, build 1.60.1.70888, level 31 warrior with nothing in the main hand: the character sheet shows 49.71 - 49.71 damage at 2.0 speed with 341 attack power, which is 1 + 341 / 14 * 2.0.

In sim the debug log for the unarmed swing now reads base=(1 to 1) ... speed=2.000 power_damage=50.14286 ap=351, the same formula.

Run on a clang C++23 debug build with -fsanitize=address,undefined, same flags as CI:

  • naked level 31 and 32 warriors, and an unarmed warrior with a shield: clean, they aborted before
  • the same character with a one-hand and a two-hand mace: clean
  • the three CI steps (spell query, Patchwerk and DungeonSlice on profiles/CI.simc): clean

Notes for review

  • Abilities that need a weapon are still disabled for the unarmed profile by the existing weapon type check ("invalid main-hand weapon type" at Trivial level). Heroic Strike is not among them and executes unarmed; I did not check in game whether it should.
  • Shaman (sc_shaman.cpp:389), druid (sc_druid.cpp:923) and hunter for the ranged slot (sc_hunter.cpp:159) have the same assert. Not touched here: I only have game data for the warrior, and the druid module is being actively worked on.
  • This overlaps with the auto attack code in [Warrior] Initial support #59; the change is a few lines and easy to carry over either way.

🤖 Generated with Claude Code

A warrior profile without a main hand weapon hit an assert in
warrior_auto_attack_t in debug builds. Release builds ran, but the
unarmed swing had no base damage.

Drop the assert and treat the empty main hand as an unarmed weapon:
2.0 swing time (the weapon_t default) and 1 base damage.

Verified in game on build 1.60.1.70888: with no weapon equipped the
character sheet shows 49.71 - 49.71 damage and 2.0 speed at 341 attack
power, which is 1 + 341 / 14 * 2.0.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@Khazakdk

Copy link
Copy Markdown
Collaborator

I'm not sure what value this brings. Its an assert so it only matters in debug builds, and someone with a debug build can just change the source if they really need to. Simming without a weapon is a highly abnormal use case. I'll let other maintainers chime in, but I'm not sure why we'd want to have robust support for weaponless sims.

@kflirik kflirik closed this Nov 14, 2026
@kflirik

kflirik commented Nov 14, 2026

Copy link
Copy Markdown
Author

Agreed, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants