{"action":"created","comment":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments/50628248","id":50628248,"diff_hunk":"@@ -10619,6 +10619,35 @@\n     },\n     {\n         \"type\" : \"ARMOR\",\n+        \"id\" : \"legpouch\",\n+        \"name\" : \"drop leg ammo pouch\",\n+        \"name_plural\" : \"drop leg ammo pouches\",\n+        \"weight\" : 100,\n+        \"color\" : \"dark_gray\",\n+        \"covers\" : [\"LEG_EITHER\"],\n+        \"storage\" : 0,\n+        \"symbol\" : \"[\",\n+        \"description\" : \"A small fabric ammo pouch that can be strapped to your leg and capable of holding a single magazine close at hand.\",\n+        \"price\" : 2000,\n+        \"material\" : [\"cotton\", \"null\"],\n+        \"volume\" : 1,\n+        \"warmth\" : 0,\n+        \"phase\" : \"solid\",\n+        \"encumbrance\" : 3,\n+        \"flags\" : [\"VARSIZE\", \"WATER_FRIENDLY\", \"BELTED\"],\n+        \"coverage\" : 15,\n+        \"material_thickness\" : 2,\n+        \"use_action\" : {\n+            \"type\": \"holster\",\n+            \"holster_prompt\": \"Stash ammo\",\n+            \"holster_msg\": \"You stash your %s\",\n+            \"max_volume\": 2,\n+            \"draw_cost\": 5,\n+            \"flags\": [ \"COMPACT_MAG\" ]","path":"data/json/items/armor.json","position":28,"original_position":28,"commit_id":"4842355b801f43f3fc1ea9b9467f8f8336534930","original_commit_id":"4842355b801f43f3fc1ea9b9467f8f8336534930","user":{"login":"mugling","id":12238606,"avatar_url":"https://avatars.githubusercontent.com/u/12238606?v=3","gravatar_id":"","url":"https://api.github.com/users/mugling","html_url":"https://github.com/mugling","followers_url":"https://api.github.com/users/mugling/followers","following_url":"https://api.github.com/users/mugling/following{/other_user}","gists_url":"https://api.github.com/users/mugling/gists{/gist_id}","starred_url":"https://api.github.com/users/mugling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mugling/subscriptions","organizations_url":"https://api.github.com/users/mugling/orgs","repos_url":"https://api.github.com/users/mugling/repos","events_url":"https://api.github.com/users/mugling/events{/privacy}","received_events_url":"https://api.github.com/users/mugling/received_events","type":"User","site_admin":false},"body":"> Do we need to have the same flag on a container and on a magazine we want to store?\r\n\r\nYes\r\n\r\n> If so, it's better to announce it in docs.\r\n\r\nSee 4842355. Is there anywhere else?","created_at":"2016-01-24T00:49:22Z","updated_at":"2016-01-24T00:49:22Z","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/14972#discussion_r50628248","pull_request_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/14972","_links":{"self":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments/50628248"},"html":{"href":"https://github.com/CleverRaven/Cataclysm-DDA/pull/14972#discussion_r50628248"},"pull_request":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/14972"}}},"pull_request":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/14972","id":56983690,"html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/14972","diff_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/14972.diff","patch_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/14972.patch","issue_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/14972","number":14972,"state":"open","locked":false,"title":"Further container logic [RDY]","user":{"login":"mugling","id":12238606,"avatar_url":"https://avatars.githubusercontent.com/u/12238606?v=3","gravatar_id":"","url":"https://api.github.com/users/mugling","html_url":"https://github.com/mugling","followers_url":"https://api.github.com/users/mugling/followers","following_url":"https://api.github.com/users/mugling/following{/other_user}","gists_url":"https://api.github.com/users/mugling/gists{/gist_id}","starred_url":"https://api.github.com/users/mugling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mugling/subscriptions","organizations_url":"https://api.github.com/users/mugling/orgs","repos_url":"https://api.github.com/users/mugling/repos","events_url":"https://api.github.com/users/mugling/events{/privacy}","received_events_url":"https://api.github.com/users/mugling/received_events","type":"User","site_admin":false},"body":"**EDIT: rebased against master**\r\n\r\nThis PR continues directly from #14949 which is not yet merged. There are 11 new commits starting with 09ff0fd. It contains extensions to `item_location` and `*::visit_items` sufficient to implement this:\r\n\r\n![ccda](https://cloud.githubusercontent.com/assets/12238606/12531914/691fc9a6-c1fe-11e5-9f54-ab1af73d4e1a.png)\r\n\r\n**This PR does not implement a UI for nested containers** but does however provide some of the key functionality that would be required. `Character::find_parent` can be used to determine whether an item has a parent container from which it can then be recursively unpacked via `item_location::obtain`.\r\n\r\nThe above screenshot demonstrates this functionality:\r\n\r\n- `STANAG magazine (30)` is contained by `drop leg ammo pouch` and worn by `Character`  \r\n\r\n- `item_location::describe` uses `Character::find_parent` to help determine the container name\r\n\r\n- `game::reload` uses `item_location::obtain` to unpack the item to the base of the inventory\r\n\r\n- Reloading then proceeds as normal via `player::assign_activity`\r\n\r\nImplementation details:\r\n\r\n- `*::visit_items` is extended to also provide a pointer to the parent node\r\n\r\n- `*::find_parent` uses the above to find any parent container\r\n\r\n- `item_location::describe` can optionally return the location relative to the player\r\n\r\n- `item_location::obtain` fetches the item to the root of the character inventor and in doing so it triggers events, eg. `item::on_takeoff` and deducts the appropriate number of moves\r\n\r\n**tl;dr**\r\nDemonstrates a wearable ammo pouch from which you can reload","created_at":"2016-01-23T19:05:07Z","updated_at":"2016-01-24T00:49:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a9363262d6be26f6f2b73e49d757ad217d237c28","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/14972/commits","review_comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/14972/comments","review_comment_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/14972/comments","statuses_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/4842355b801f43f3fc1ea9b9467f8f8336534930","head":{"label":"mugling:containers1","ref":"containers1","sha":"4842355b801f43f3fc1ea9b9467f8f8336534930","user":{"login":"mugling","id":12238606,"avatar_url":"https://avatars.githubusercontent.com/u/12238606?v=3","gravatar_id":"","url":"https://api.github.com/users/mugling","html_url":"https://github.com/mugling","followers_url":"https://api.github.com/users/mugling/followers","following_url":"https://api.github.com/users/mugling/following{/other_user}","gists_url":"https://api.github.com/users/mugling/gists{/gist_id}","starred_url":"https://api.github.com/users/mugling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mugling/subscriptions","organizations_url":"https://api.github.com/users/mugling/orgs","repos_url":"https://api.github.com/users/mugling/repos","events_url":"https://api.github.com/users/mugling/events{/privacy}","received_events_url":"https://api.github.com/users/mugling/received_events","type":"User","site_admin":false},"repo":{"id":35048130,"name":"Cataclysm-DDA","full_name":"mugling/Cataclysm-DDA","owner":{"login":"mugling","id":12238606,"avatar_url":"https://avatars.githubusercontent.com/u/12238606?v=3","gravatar_id":"","url":"https://api.github.com/users/mugling","html_url":"https://github.com/mugling","followers_url":"https://api.github.com/users/mugling/followers","following_url":"https://api.github.com/users/mugling/following{/other_user}","gists_url":"https://api.github.com/users/mugling/gists{/gist_id}","starred_url":"https://api.github.com/users/mugling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mugling/subscriptions","organizations_url":"https://api.github.com/users/mugling/orgs","repos_url":"https://api.github.com/users/mugling/repos","events_url":"https://api.github.com/users/mugling/events{/privacy}","received_events_url":"https://api.github.com/users/mugling/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mugling/Cataclysm-DDA","description":"Cataclysm - Dark Days Ahead. A fork/variant of Cataclysm Roguelike by Whales.","fork":true,"url":"https://api.github.com/repos/mugling/Cataclysm-DDA","forks_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/forks","keys_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/teams","hooks_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/hooks","issue_events_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/issues/events{/number}","events_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/events","assignees_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/assignees{/user}","branches_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/branches{/branch}","tags_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/tags","blobs_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/git/refs{/sha}","trees_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/statuses/{sha}","languages_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/languages","stargazers_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/stargazers","contributors_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/contributors","subscribers_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/subscribers","subscription_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/subscription","commits_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/commits{/sha}","git_commits_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/git/commits{/sha}","comments_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/comments{/number}","issue_comment_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/issues/comments{/number}","contents_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/contents/{+path}","compare_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/merges","archive_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/downloads","issues_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/issues{/number}","pulls_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/pulls{/number}","milestones_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/milestones{/number}","notifications_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/labels{/name}","releases_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/releases{/id}","deployments_url":"https://api.github.com/repos/mugling/Cataclysm-DDA/deployments","created_at":"2015-05-04T17:12:42Z","updated_at":"2016-01-12T23:34:36Z","pushed_at":"2016-01-24T00:38:43Z","git_url":"git://github.com/mugling/Cataclysm-DDA.git","ssh_url":"git@github.com:mugling/Cataclysm-DDA.git","clone_url":"https://github.com/mugling/Cataclysm-DDA.git","svn_url":"https://github.com/mugling/Cataclysm-DDA","homepage":"http://en.cataclysmdda.com/","size":683040,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"CleverRaven:master","ref":"master","sha":"12a32b2ef9ba2ef44f35619b526b5d2688d1a1b8","user":{"login":"CleverRaven","id":4367009,"avatar_url":"https://avatars.githubusercontent.com/u/4367009?v=3","gravatar_id":"","url":"https://api.github.com/users/CleverRaven","html_url":"https://github.com/CleverRaven","followers_url":"https://api.github.com/users/CleverRaven/followers","following_url":"https://api.github.com/users/CleverRaven/following{/other_user}","gists_url":"https://api.github.com/users/CleverRaven/gists{/gist_id}","starred_url":"https://api.github.com/users/CleverRaven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CleverRaven/subscriptions","organizations_url":"https://api.github.com/users/CleverRaven/orgs","repos_url":"https://api.github.com/users/CleverRaven/repos","events_url":"https://api.github.com/users/CleverRaven/events{/privacy}","received_events_url":"https://api.github.com/users/CleverRaven/received_events","type":"Organization","site_admin":false},"repo":{"id":5973855,"name":"Cataclysm-DDA","full_name":"CleverRaven/Cataclysm-DDA","owner":{"login":"CleverRaven","id":4367009,"avatar_url":"https://avatars.githubusercontent.com/u/4367009?v=3","gravatar_id":"","url":"https://api.github.com/users/CleverRaven","html_url":"https://github.com/CleverRaven","followers_url":"https://api.github.com/users/CleverRaven/followers","following_url":"https://api.github.com/users/CleverRaven/following{/other_user}","gists_url":"https://api.github.com/users/CleverRaven/gists{/gist_id}","starred_url":"https://api.github.com/users/CleverRaven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CleverRaven/subscriptions","organizations_url":"https://api.github.com/users/CleverRaven/orgs","repos_url":"https://api.github.com/users/CleverRaven/repos","events_url":"https://api.github.com/users/CleverRaven/events{/privacy}","received_events_url":"https://api.github.com/users/CleverRaven/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CleverRaven/Cataclysm-DDA","description":"Cataclysm - Dark Days Ahead. A fork/variant of Cataclysm Roguelike by Whales.","fork":false,"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA","forks_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/forks","keys_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/teams","hooks_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/hooks","issue_events_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/events{/number}","events_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/events","assignees_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/assignees{/user}","branches_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/branches{/branch}","tags_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/tags","blobs_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/refs{/sha}","trees_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/{sha}","languages_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/languages","stargazers_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/stargazers","contributors_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/contributors","subscribers_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/subscribers","subscription_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/subscription","commits_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/commits{/sha}","git_commits_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/commits{/sha}","comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/comments{/number}","issue_comment_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/comments{/number}","contents_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/contents/{+path}","compare_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/merges","archive_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/downloads","issues_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues{/number}","pulls_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls{/number}","milestones_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/milestones{/number}","notifications_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/labels{/name}","releases_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/releases{/id}","deployments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/deployments","created_at":"2012-09-26T22:57:43Z","updated_at":"2016-01-23T08:07:24Z","pushed_at":"2016-01-24T00:47:13Z","git_url":"git://github.com/CleverRaven/Cataclysm-DDA.git","ssh_url":"git@github.com:CleverRaven/Cataclysm-DDA.git","clone_url":"https://github.com/CleverRaven/Cataclysm-DDA.git","svn_url":"https://github.com/CleverRaven/Cataclysm-DDA","homepage":"http://en.cataclysmdda.com/","size":930853,"stargazers_count":856,"watchers_count":856,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":844,"mirror_url":null,"open_issues_count":1262,"forks":844,"open_issues":1262,"watchers":856,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/14972"},"html":{"href":"https://github.com/CleverRaven/Cataclysm-DDA/pull/14972"},"issue":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/14972"},"comments":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/14972/comments"},"review_comments":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/14972/comments"},"review_comment":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/14972/commits"},"statuses":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/4842355b801f43f3fc1ea9b9467f8f8336534930"}}}}