CleverRaven/Cataclysm-DDA — pull request #7660 by BevapDin (2014-05-16 14:02:15+00:00)
Title: Fix to search for item categories and materials (search translation & case-insensitive)

The current code actually matches only the material ident, not even the untranslated material name: Find a strawberry, its material is listed as "Fruit Matter", filter with "{m:Matter}" - no results, filter with "{m:fruit}" - strawberry shows up.

Changed the check in `material_type::is_null` to `ident == "null"`. Set the standard material ident to "null". This should eliminate any references to a material with ident "". This will also make `material_type::is_null` work as expected. "data/json/materials.json" already contains a material with ident "null". It is also consistent with all the other `is_null` methods, which check for "NULL" or "null" as ident.

Made `item::get_material` return the material pointer directly. The previously returned material ident has in each case been used to get the `material_type` object anyway. This simply moves that call to `material_type::find_material` into `item::get_material`.

And finally search the material name (which is already translated) instead of the material ident. The existing code already searched the translated category name. I added a case-insensitive search (as far as this is possible without a proper Unicode library).

Fixes #6750