CleverRaven/Cataclysm-DDA — pull request #4687 by BevapDin (2013-11-25 13:36:50+00:00)
Title: Check json item definitions consistency

This adds some checks for consistent item type definitions and references, (only done with --verifyjson).
If a check fails, a debug message is printed.

Checks that components/tools & result of recipes refer to existing item types in item_controller (prevents the "char_smoke" in #4680).

Same for each item in each item group (prevents things like #4683, #4567).

Checks that it_ammo::casing, it_tool::reverts_to, it_comest::tool, it_comest::container are defined item types (or "NULL" / "null") - (prevents things like #3721, #3360).

Checks various ammo references - they should be listed in ammo_name() and checks that at least one item type of this ammo exists. This is skipped for tools with no max_charges (folding bicycle uses ammo "none", most other tools use "NULL").

Checks that item material (m1, m2) refer to known materials.
material_type::find_material will return a NULL pointer on invalid materials, can be seen when a sealed 3l-jar of kompot (or any mutagen) is put into an acid pool - will cause a segfault ("Tried to get invalid material: ..."). This can easily happen: a zombie dies and drops jar_kompot, a spitter creates an acid pool.

As a fix for the material bug: changed the material for mutagens from "NULL" to "null", as this is the material id used in materials.json.

jar_kompot has material "water", pudding & yoghurt have material "milk" - both materials are not listed in materials.json - this will trigger the same bug as above. Therefor material_type::find_material returns now a pointer to a null material instead of a null pointer.