Skip to content

Add looks_like consistency check and fix broken references#85604

Draft
dumb-kevin wants to merge 2 commits intoCleverRaven:masterfrom
dumb-kevin:improve/fix-looks-like-refs
Draft

Add looks_like consistency check and fix broken references#85604
dumb-kevin wants to merge 2 commits intoCleverRaven:masterfrom
dumb-kevin:improve/fix-looks-like-refs

Conversation

@dumb-kevin
Copy link
Contributor

@dumb-kevin dumb-kevin commented Mar 1, 2026

Summary

Infrastructure "Add looks_like consistency check for items"

Purpose of change

Companion to #85591. Item looks_like fields were never validated, so typos, renames, and removals silently broke visual fallbacks.

Describe the solution

Add a check in Item_factory::check_definitions() that validates looks_like against item, furniture, terrain, and trap registries. Fix all 56 broken references across 25 JSON files.

Describe alternatives you've considered

Could skip cross-type validation (furniture/terrain/trap), but those refs are intentional and valid.

Testing

./tests/cata_test '[iteminfo]' -- zero invalid looks_like errors.

Additional context

Most breakage came from past renames (power_armor -> exoskeleton, chainmail -> mc/lc_chainmail, 30l_barrel -> 30gal_barrel, etc.), one trailing-space typo, and one removed item.

Validate EOC string references, item repairs_like / source_monster /
cooks_like / smoking_result / rot_spawn, summon spells with zero
duration, profession CBM-without-interface, and start_location
om_terrain references.  Fix looks_like pointing at removed
power_armor_basic / knife_butcher, and use PREFIX match for
urban_library variants.  Add recipe cycle test for craft/uncraft
exploits.
@github-actions github-actions bot added Code: Build Issues regarding different builds and build environments [JSON] Changes (can be) made in JSON Map / Mapgen Overmap, Mapgen, Map extras, Map display Items: Food / Vitamins Comestibles and drinks Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` Scenarios New Scenarios, balancing, bugs with scenarios [Python] Code made in Python Mods: Magiclysm Anything to do with the Magiclysm mod Mods: Aftershock Anything to do with the Aftershock mod Items: Containers Things that hold other things Mechanics: Enchantments / Spells Enchantments and spells Mods: MA Massachussetts mod. Cata in one state Items: Armor / Clothing Armor and clothing Appliance/Power Grid Anything to do with appliances and power grid Mods: MMA Mythical Martial Arts mod EOC: Effects On Condition Anything concerning Effects On Condition Mods: Innawood 🌲 Anything to do with Innawood mod Mods: Xedra Evolved Anything to do with Xedra Evolved Mods: Mind Over Matter Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Appliance/Power Grid Anything to do with appliances and power grid astyled astyled PR, label is assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Build Issues regarding different builds and build environments Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Code: Tests Measurement, self-control, statistics, balancing. Crafting / Construction / Recipes Includes: Uncrafting / Disassembling EOC: Effects On Condition Anything concerning Effects On Condition Items: Armor / Clothing Armor and clothing Items: Containers Things that hold other things Items: Food / Vitamins Comestibles and drinks [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display Mechanics: Enchantments / Spells Enchantments and spells Mods: Aftershock Anything to do with the Aftershock mod Mods: Innawood 🌲 Anything to do with Innawood mod Mods: MA Massachussetts mod. Cata in one state Mods: Magiclysm Anything to do with the Magiclysm mod Mods: Mind Over Matter Mods: MMA Mythical Martial Arts mod Mods: Xedra Evolved Anything to do with Xedra Evolved Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies [Python] Code made in Python Scenarios New Scenarios, balancing, bugs with scenarios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant