CleverRaven/Cataclysm-DDA — pull request #5238 by atomicdryad (2013-12-28 03:54:26+00:00)
Title: Bad itype on game load: don't autovivicate itypes[], save itype string and restore if it becomes valid. Fix artifacts. Again.

If a savegame contains an item with typeid "foobar", and "foobar" is not valid:
* don't pollute itypes with make(itypes["foobar"]), make use of itypes.find("foobar") to check first
* as before assign item as 'null', but stash item.item_vars["_invalid_itype_"] = "foobar" so savegame inspection can reveal the culprit, and:

If a savegame contains an item with typeid "null"
* Attempt to use item_vars["_invalid_itype_"] if present

This allows for automagic item recovery in the event of mod toggling.

*also*: Fix artifacts (again):
* itype::id is std::string, don't set it from int or stuff int keys in itypes[]
* make id assignment automagic in artifact itype constructor

*bonus*: item::tname():
* Indicate the presense of item_vars["item_note"], not !item_vars.empty()