CleverRaven/Cataclysm-DDA — pull request #9735 by BevapDin (2014-10-29 10:55:51+00:00)
Title: Fix rotten items stacking

Fixes #7432

Items only stack when the `item::stacks_with` returns true. That function now also checks the spoiling and the rot of the items (items with different rot values don't stack).

The function is also used by items that are counted by charges. The previous logic was:
- if the item is counted by charges *and* the item type matches (but nothing except the type!), than combine the charges.
- else (player inventory only): if the items stack (according to `item::stacks_with`) stack them
- else add a separate item.

Now it's:
- if the items stack (according to `item::stacks_with`), stack them (in player inventory) or merge charges (map and player inventory)
- else add a separate item.

This will make separate stacks of "damaged arrow" and "arrow", but also "cracklins (hot) (2)" and "cracklins (rotten) (2)".

It affects items on the ground, in vehicles and in the player inventory.