{"action":"created","comment":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments/42788344","id":42788344,"diff_hunk":"@@ -589,13 +589,13 @@ class jmapgen_alternativly : public jmapgen_piece {\n     // PieceType, they *can not* be of any other type.\n     std::vector<PieceType> alternatives;\n     jmapgen_alternativly() = default;\n-    void apply( map &m, const size_t x, const size_t y, const float mon_density ) const override\n+    void apply( map &m, const size_t x, const size_t y, const size_t xmin, const size_t ymin, const size_t xmax, const size_t ymax, const float mon_density ) const override","path":"src/mapgen.cpp","position":null,"original_position":5,"commit_id":"16553b760a133eb4f6110a21d7f45ab51a4fb85e","original_commit_id":"63c621f0313745848174152dcc0792c881fa54da","user":{"login":"BevapDin","id":5095435,"avatar_url":"https://avatars.githubusercontent.com/u/5095435?v=3","gravatar_id":"","url":"https://api.github.com/users/BevapDin","html_url":"https://github.com/BevapDin","followers_url":"https://api.github.com/users/BevapDin/followers","following_url":"https://api.github.com/users/BevapDin/following{/other_user}","gists_url":"https://api.github.com/users/BevapDin/gists{/gist_id}","starred_url":"https://api.github.com/users/BevapDin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BevapDin/subscriptions","organizations_url":"https://api.github.com/users/BevapDin/orgs","repos_url":"https://api.github.com/users/BevapDin/repos","events_url":"https://api.github.com/users/BevapDin/events{/privacy}","received_events_url":"https://api.github.com/users/BevapDin/received_events","type":"User","site_admin":false},"body":"Perhaps it would be better to forward the whole `jmapgen_int` (as const reference) instead of splitting it here. There are quite a few functions that need to combine those two values (min, max) into one via `rng` later on, they could use `jmapgen_int::get()` instead.\r\n\r\nThis may also be better for the future, if (when) `jmapgen_int` gets expanded to allow other distributions.","created_at":"2015-10-22T18:40:41Z","updated_at":"2015-10-22T18:40:41Z","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/13753#discussion_r42788344","pull_request_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/13753","_links":{"self":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments/42788344"},"html":{"href":"https://github.com/CleverRaven/Cataclysm-DDA/pull/13753#discussion_r42788344"},"pull_request":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/13753"}}},"pull_request":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/13753","id":47615329,"html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/13753","diff_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/13753.diff","patch_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/13753.patch","issue_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/13753","number":13753,"state":"open","locked":false,"title":"[CR] Expand json apply method to take rectangle coordinates for randomization of item placement location.","user":{"login":"DanmakuDan","id":9610892,"avatar_url":"https://avatars.githubusercontent.com/u/9610892?v=3","gravatar_id":"","url":"https://api.github.com/users/DanmakuDan","html_url":"https://github.com/DanmakuDan","followers_url":"https://api.github.com/users/DanmakuDan/followers","following_url":"https://api.github.com/users/DanmakuDan/following{/other_user}","gists_url":"https://api.github.com/users/DanmakuDan/gists{/gist_id}","starred_url":"https://api.github.com/users/DanmakuDan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanmakuDan/subscriptions","organizations_url":"https://api.github.com/users/DanmakuDan/orgs","repos_url":"https://api.github.com/users/DanmakuDan/repos","events_url":"https://api.github.com/users/DanmakuDan/events{/privacy}","received_events_url":"https://api.github.com/users/DanmakuDan/received_events","type":"User","site_admin":false},"body":"This is a fix for user-created mapgen dropping things in single tile piles, which kind of breaks immersion when you notice it. The item generation location was determined before place_items could use its randomizing loop to pick multiple locations to place an item. By adding x1y1/x2y2 parameters to the apply method for jmapgen_*, the item placement method can use the original bounding rectangle to place items, similar to hardcoded house mapgen calls. This method change looks a little bulky, so I would like to know if this is an acceptable change. The method is abstracted across all jmapgen types, so the base method had to be changed and applied to all inheritors.\r\n\r\nBefore jmapgen apply change (notice items being examined):\r\n![cata_prefab1](https://cloud.githubusercontent.com/assets/9610892/10474420/2e23a63a-71fc-11e5-9f4c-23ec0bdf6284.png)\r\n![cata_prefab2](https://cloud.githubusercontent.com/assets/9610892/10474424/3c340c56-71fc-11e5-8fb1-fb0ea09b0f2b.png)\r\n\r\nAfter jmapgen apply change (house_garage.json):\r\n![cata_rng1](https://cloud.githubusercontent.com/assets/9610892/10474427/4377cf0c-71fc-11e5-8d83-5f6a8fe70962.png)\r\n![cata_rng2](https://cloud.githubusercontent.com/assets/9610892/10474430/45a814b2-71fc-11e5-9fac-eff24ba1832a.png)\r\n\r\n","created_at":"2015-10-14T03:50:49Z","updated_at":"2015-10-22T18:40:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c58cc8ff569782b579bca51bf7ebf8112bc0b7c4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/13753/commits","review_comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/13753/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/13753/comments","statuses_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/16553b760a133eb4f6110a21d7f45ab51a4fb85e","head":{"label":"DanmakuDan:map_place_items","ref":"map_place_items","sha":"16553b760a133eb4f6110a21d7f45ab51a4fb85e","user":{"login":"DanmakuDan","id":9610892,"avatar_url":"https://avatars.githubusercontent.com/u/9610892?v=3","gravatar_id":"","url":"https://api.github.com/users/DanmakuDan","html_url":"https://github.com/DanmakuDan","followers_url":"https://api.github.com/users/DanmakuDan/followers","following_url":"https://api.github.com/users/DanmakuDan/following{/other_user}","gists_url":"https://api.github.com/users/DanmakuDan/gists{/gist_id}","starred_url":"https://api.github.com/users/DanmakuDan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanmakuDan/subscriptions","organizations_url":"https://api.github.com/users/DanmakuDan/orgs","repos_url":"https://api.github.com/users/DanmakuDan/repos","events_url":"https://api.github.com/users/DanmakuDan/events{/privacy}","received_events_url":"https://api.github.com/users/DanmakuDan/received_events","type":"User","site_admin":false},"repo":{"id":30150110,"name":"Cataclysm-DDA","full_name":"DanmakuDan/Cataclysm-DDA","owner":{"login":"DanmakuDan","id":9610892,"avatar_url":"https://avatars.githubusercontent.com/u/9610892?v=3","gravatar_id":"","url":"https://api.github.com/users/DanmakuDan","html_url":"https://github.com/DanmakuDan","followers_url":"https://api.github.com/users/DanmakuDan/followers","following_url":"https://api.github.com/users/DanmakuDan/following{/other_user}","gists_url":"https://api.github.com/users/DanmakuDan/gists{/gist_id}","starred_url":"https://api.github.com/users/DanmakuDan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanmakuDan/subscriptions","organizations_url":"https://api.github.com/users/DanmakuDan/orgs","repos_url":"https://api.github.com/users/DanmakuDan/repos","events_url":"https://api.github.com/users/DanmakuDan/events{/privacy}","received_events_url":"https://api.github.com/users/DanmakuDan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DanmakuDan/Cataclysm-DDA","description":"Cataclysm - Dark Days Ahead. A fork/variant of Cataclysm Roguelike by Whales.","fork":true,"url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA","forks_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/forks","keys_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/teams","hooks_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/hooks","issue_events_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/issues/events{/number}","events_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/events","assignees_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/assignees{/user}","branches_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/branches{/branch}","tags_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/tags","blobs_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/git/refs{/sha}","trees_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/statuses/{sha}","languages_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/languages","stargazers_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/stargazers","contributors_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/contributors","subscribers_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/subscribers","subscription_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/subscription","commits_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/commits{/sha}","git_commits_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/git/commits{/sha}","comments_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/comments{/number}","issue_comment_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/issues/comments{/number}","contents_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/contents/{+path}","compare_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/merges","archive_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/downloads","issues_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/issues{/number}","pulls_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/pulls{/number}","milestones_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/milestones{/number}","notifications_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/labels{/name}","releases_url":"https://api.github.com/repos/DanmakuDan/Cataclysm-DDA/releases{/id}","created_at":"2015-02-01T15:34:09Z","updated_at":"2015-04-27T19:53:31Z","pushed_at":"2015-10-18T03:07:52Z","git_url":"git://github.com/DanmakuDan/Cataclysm-DDA.git","ssh_url":"git@github.com:DanmakuDan/Cataclysm-DDA.git","clone_url":"https://github.com/DanmakuDan/Cataclysm-DDA.git","svn_url":"https://github.com/DanmakuDan/Cataclysm-DDA","homepage":"http://en.cataclysmdda.com/","size":546614,"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":"846944eb5f04a66c7ffd083fa961611f801fb4d8","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}","created_at":"2012-09-26T22:57:43Z","updated_at":"2015-10-22T12:23:12Z","pushed_at":"2015-10-22T18:33:15Z","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":849973,"stargazers_count":757,"watchers_count":757,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":783,"mirror_url":null,"open_issues_count":1111,"forks":783,"open_issues":1111,"watchers":757,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/13753"},"html":{"href":"https://github.com/CleverRaven/Cataclysm-DDA/pull/13753"},"issue":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/13753"},"comments":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/13753/comments"},"review_comments":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/13753/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/13753/commits"},"statuses":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/16553b760a133eb4f6110a21d7f45ab51a4fb85e"}}}}