CleverRaven/Cataclysm-DDA — pull request #7374 by BevapDin (2014-04-23 22:17:31+00:00)
Title: Fix bugs (artifact?, ssize_t)

This contains two commits, which are too small for separate PRs. If you only need one of them, I can remove the other one.

----

070f6a4: Fixes #6890. The use of `ssize_t` is of course not needed and actually wrong.

----

6ddcdb0: might fix #7299.

The problem could be the format "%zu" (used to generate the artifact id). It seems to be unsupported/broken in mingw ( http://sourceforge.net/p/mingw-w64/discussion/723798/thread/7a8de6e0/ ). This might result in the same item id all the time: "artifact_zu".

When creating a new artifact, the `it_artifact_...` object is put into the `itypes` map, and *overrides* any existing entry of the same id (that would be the previously created `it_artifact_...` object). Only the last artifact created remains in the map and only that one is stored when saving.

As only the pointer to the `it_artifact_...` object are used during the runtime, all created artifacts remain different until the game is closed. Saving only writes the `id` which would be the same for all artifacts.

The commit changes it to use the "%d" format. This format is used all over the place. It is therefor easy to recognize when the game runs on a platform that does not support that format correctly (if there is any). If the game shows numbers correctly, the artifact ids will be unique, too.