Repository navigation
feat(map-checker): warn about monsters and NPCs with no loot - #36
Merged
Merged
Conversation
Flag map monsters that have neither a randomitems treasure list nor droppable inventory items. The classic server falls back to generic loot for these and logs an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BPTYArGhoPqP7UdeUuUC5j
Dependency Review✅ No vulnerabilities or license issues found.Scanned FilesNone |
zoeyrose
added a commit
to atrinik/classic
that referenced
this pull request
Nov 26, 2026
<!-- claude-projects-attribution: {"github_login":"zoeyrose"} -->
_Requested by **Zoey** · [project
thread](https://claude.ai/code/project/chan_01GqFGRfVxfKgHRxSgL4g4qr?thread=cmsg_01GqFGRfVxfKgHRxSgL4g4qr38thrxw4CAaXppYJEuqoHr)_
## Summary
This follows #656. When a non-player monster is killed and carries
nothing that would drop, the server now generates the content
`fallback_loot` treasure list into its inventory before
`object_destruct()`, so every monster leaves something behind.
- "Droppable" follows `object_drop_inventory()`: items that are sys
objects, start equipment, no-drop, quest containers or runes don't
count.
- If the monster has **no `randomitems` at all**, the server logs
`LOG(ERROR, "Monster has no loot, dropping fallback loot: ...")`. That
points to a content problem. A monster whose treasure list just rolled
nothing gets the fallback without an error.
- Owned monsters (pets, golems, summons) and monsters flagged
`startequip` are skipped, so summoning stays unfarmable.
- If `fallback_loot` is missing, `treasure_list_find()` logs its usual
error and nothing is generated.
## Dependencies
Includes the v1.21.0 content lock bump from #658, which the
update-content automation opened. v1.21.0 is the first content release
with `fallback_loot` (atrinik/content#283).
Merge #658 first, or merge this alone, since it carries the same commit.
The map-checker counterpart is atrinik/tools#36.
## Tests
New tests in `server/src/tests/unit/server/attack.c`:
- `test_lootless_monster_drops_fallback_loot`: a monster with no
`randomitems` and no droppable inventory drops coins.
- `test_owned_monster_gets_no_fallback_loot`: an owned monster gets no
fallback loot.
CI runs the native build and tests (Server validation and Classic
validation are green). I couldn't build locally because the required
Clang 23 toolchain isn't available here.
---
_Generated by [Claude Code](https://claude.ai/code)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: atrinik-classic-dependency-updater[bot] <315991295+atrinik-classic-dependency-updater[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Zoey · project thread
Summary
The Qt map checker now warns when a monster or NPC placed on a map has no loot. A monster has loot when:
randomitemsto a real treasure list (noneandemptydon't count), orsys_object,startequip,no_drop, event objects or quest containers don't count.The check reuses
checker_monsterand only runs for objects on maps, not archetype definitions. The severity iswarning. This goes with atrinik/classic#656, where non-player monsters always drop loot, and with the follow-up server change that dropsfallback_loot(atrinik/content#283) and logs an error when a monster has none.Current content
A full focused scan of a runtime build of
atrinik/content@maincurrently reports 361 monsters/NPCs with no loot. They are mostly town NPCs:ant_red"removable" objects (47),mage_old,peasant,monk, priests, smiths and similar. These are warnings, so the scan's exit status doesn't change.Validation
python3 -m unittest discover -s map-checker-qt/tests -v: 36 tests pass, including 8 new ones intests/test_checker_loot.py.python3 -W error -m compileall -q -f map-checker-qtpython3 dependencies.py syncfollowed by a full CLI scan of a locally built classic runtime, with the results above.git diff --checkGenerated by Claude Code