CleverRaven/Cataclysm-DDA — pull request #9823 by BevapDin (2014-11-04 00:09:18+00:00)
Title: Fix charges of kompot and spanwing in shelter basement.

Fixes #9639 - charges of canned food, see commit text. Basically when the iuse action sets the charges of the item (12 units of kompot), than don't remove charges as one would otherwise do (transforming a flashlight into an active flashlight cost a charge). This keeps the 12 charges according to the transform function in the json data.

Changed the sealed jar / vacuum packed stuff to be a generic item instead of a tool. This prevents the "jar (1)" after it has been opened and unloaded (might only work for newly create items, existing items from previous saves might still have that one charge, it shouldn't affect anything). The problem here was that the "sealed jar" item starts out as having one charge (it's a tool, default charges is 1), and those charges remained after it has been opened.

Fixes spawning in the shelter basement, see commit text.

----

Possible bugs (but not my scope): pickled meat and pickled veggy (the items without the jar, that you get when opening the jar) do not spoil. I could craft "sealed jar of pickled meat", open it, unload it, stash the pickled meat item somewhere, and use the jar for another bunch of "sealed jar of pickled meat" ad infinitum. Pickled punk and pickled fish have the same problem.