Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Weapon hits check the wrong resistance, so 46 mobs resist melee by accident

Open
#422 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp
Domain
game-dev

Research direction

Start with check_resistances in src/utility.cpp and read the LegacyWeaponResistOrder tests plus uses_legacy_weapon_spec, which intentionally preserve the current order while #315 is tested on live. Before changing behavior, recount affected mobs against the world files and review the listed major fights. Done means weapon hits and arrows use physical resistance and vulnerability as intended, with the separate special attack design question resolved.

Written by the indexing model from the issue text.

Description

bug
Who notices this?

Players, Builders

What happens today?

Weapon hits and arrows check the wrong resistance. 46 mobs resist melee, or take extra melee damage, when their files never say they should.

Weapons and archery are meant to check only a mob's physical resistance and vulnerability. Since a 2018 change, every weapon swing and arrow first checks a different flag, "ungrouped" (bit 0), and only then checks physical (bludgeon checks bit 14 instead of bit 0). Any mob carrying bit 0 is treated as resistant or vulnerable to weapons:

  • 44 mobs take a third less damage from most weapon hits and arrows. 41 of them share the same mask, 17 (ungrouped + protection), copied into both resistance and vulnerability.
  • 2 mobs take half again as much damage from every weapon hit: Muzgash the emerald (#6408) and a small brown lizard (#7001).
  • Some of them are real fights: the Lord of the Tower (#29800, level 93), the fell beasts of Dol-Guldur and Mor Erlond (#27582, #27728), and Vaz the enchanter (#29808, #29809). Most of the rest are town NPCs and small critters.

The test server's world adds one more: a snowdrift (#13900) takes half again as much damage from weapons. It will reach live with the next world copy.

What should happen instead?

Weapon hits and arrows check physical resistance and vulnerability only, as the original code intended. A mob resists weapons only when its file gives it physical resistance.

How can someone see it in game?
  1. Find a rat (#2307). Its file gives it no physical resistance, only ungrouped and protection.
  2. Hit it with any weapon.
  3. On most hits, the room reads "A rat resists a lot." and the damage is cut by a third.
Where in the game?

Melee and archery against the 46 mobs, in many zones. The full list, with each mob's level and masks, is on the findings page below.

Anything else?

Why it happens. check_resistances (src/utility.cpp) looks up the attack's own row in the skill table before its weapon block, which checks physical. Weapon types are 130-143. Before 2018 the table held 128 skills, so weapon hits skipped that lookup and went straight to physical. Commit 2bcee24 (2018-06-13, "Switched mark to a touch attack...") raised MAX_SKILLS to 256, which put weapon types inside the table. Their rows are blank placeholders naming bit 0, except row 131, where defend was added in 489b7f1 (2023), so bludgeon checks bit 14. No mob sets bit 14 today. Archery (skill 61) has checked bit 0 since the original code.

Held back on purpose, for now. The resistance work (#315, merged 2026-09-29) keeps today's order deliberately, in uses_legacy_weapon_spec, pinned by 7 LegacyWeaponResistOrder tests. Changing mob toughness in the same release as resistance magnitudes would make the two impossible to tell apart in testing. The plan is to fix this after #315 has been tested and is live. As of 2026-10-18, #315 is on the test server but not on live.

A separate question to settle with it. Special attacks (bash, ambush, maul, bite, rend, smash, stomp, overrun, cleave, trap, mark, windblast, blinding) also check bit 0, on live and in release-frodo. Fixing only weapons would leave the 44 mobs resisting a bash but not a sword, while physically resistant mobs still don't resist a bash at all. Whether special attacks should check physical is a design call, and nothing is decided.

Before fixing. Some of these mobs may have been tuned around how they play today. A builder may want to look at the bigger fights first. Recount the mobs against the world files at the time of the fix: the counts above come from the 2026-09-28 live pull and the 2026-09-30 test pull.

Findings page, with the full mob list and the history: https://claude.ai/artifact/7hzXiP2LqP1giNQwLZjz26

Dominant language
C++
Stars
3
Forks
4
Avg merge
18h 36m
Merged PRs (30d)
87

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from returnoftheshadow/RotS_Live

All issues in returnoftheshadow/RotS_Live

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.