{"action":"created","comment":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments/31005343","id":31005343,"diff_hunk":"@@ -433,20 +433,36 @@ bool map::process_fields_in_submap( submap *const current_submap,\n                                     const int submap_x, const int submap_y, const int submap_z )\n {\n     const auto get_neighbors = [this]( const tripoint &pt ) {\n+        // Wrapper to allow skipping bound checks except at the edges of the map\n+        const auto maptile_has_bounds = [this]( const tripoint &pt, const bool bounds_checked ) {\n+            if( bounds_checked ) {\n+                // We know that the point is in bounds\n+                return maptile_at_internal( pt );\n+            }\n+\n+            return maptile_at( pt );\n+        };\n+\n+        // Find out which edges are in the bubble\n+        // Where possible, do just one bounds check for all the neighbors\n+        const bool west = pt.x > 0;\n+        const bool north = pt.y > 0;\n+        const bool east = pt.x < SEEX * my_MAPSIZE - 1;\n+        const bool south = pt.y < SEEY * my_MAPSIZE - 1;\n         return std::array< maptile, 8 > { {\n-            maptile_at( {pt.x - 1, pt.y - 1, pt.z} ),\n-            maptile_at( {pt.x, pt.y - 1, pt.z} ),\n-            maptile_at( {pt.x + 1, pt.y - 1, pt.z} ),\n-            maptile_at( {pt.x - 1, pt.y, pt.z} ),\n-            maptile_at( {pt.x + 1, pt.y, pt.z} ),\n-            maptile_at( {pt.x - 1, pt.y + 1, pt.z} ),\n-            maptile_at( {pt.x, pt.y + 1, pt.z} ),\n-            maptile_at( {pt.x + 1, pt.y + 1, pt.z} ),\n+            maptile_has_bounds( {pt.x - 1, pt.y - 1, pt.z}  , west && north ),\n+            maptile_has_bounds( {pt.x, pt.y - 1, pt.z}      , north ),\n+            maptile_has_bounds( {pt.x + 1, pt.y - 1, pt.z}  , east && north ),\n+            maptile_has_bounds( {pt.x - 1, pt.y, pt.z}      , west ),\n+            maptile_has_bounds( {pt.x + 1, pt.y, pt.z}      , east ),\n+            maptile_has_bounds( {pt.x - 1, pt.y + 1, pt.z}  , east && north ),","path":"src/field.cpp","position":34,"original_position":34,"commit_id":"5e17fcd290438cc0253fa6077539430c812861e6","original_commit_id":"5e17fcd290438cc0253fa6077539430c812861e6","user":{"login":"kevingranade","id":860276,"avatar_url":"https://avatars.githubusercontent.com/u/860276?v=3","gravatar_id":"","url":"https://api.github.com/users/kevingranade","html_url":"https://github.com/kevingranade","followers_url":"https://api.github.com/users/kevingranade/followers","following_url":"https://api.github.com/users/kevingranade/following{/other_user}","gists_url":"https://api.github.com/users/kevingranade/gists{/gist_id}","starred_url":"https://api.github.com/users/kevingranade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevingranade/subscriptions","organizations_url":"https://api.github.com/users/kevingranade/orgs","repos_url":"https://api.github.com/users/kevingranade/repos","events_url":"https://api.github.com/users/kevingranade/events{/privacy}","received_events_url":"https://api.github.com/users/kevingranade/received_events","type":"User","site_admin":false},"body":"copypasta fail, needs to be west && south","created_at":"2015-05-26T05:28:10Z","updated_at":"2015-05-26T05:28:10Z","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/12463#discussion_r31005343","pull_request_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/12463","_links":{"self":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments/31005343"},"html":{"href":"https://github.com/CleverRaven/Cataclysm-DDA/pull/12463#discussion_r31005343"},"pull_request":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/12463"}}},"pull_request":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/12463","id":36148909,"html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/12463","diff_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/12463.diff","patch_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/12463.patch","issue_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/12463","number":12463,"state":"open","locked":false,"title":"Make fields spread across z-levels","user":{"login":"Coolthulhu","id":1878860,"avatar_url":"https://avatars.githubusercontent.com/u/1878860?v=3","gravatar_id":"","url":"https://api.github.com/users/Coolthulhu","html_url":"https://github.com/Coolthulhu","followers_url":"https://api.github.com/users/Coolthulhu/followers","following_url":"https://api.github.com/users/Coolthulhu/following{/other_user}","gists_url":"https://api.github.com/users/Coolthulhu/gists{/gist_id}","starred_url":"https://api.github.com/users/Coolthulhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Coolthulhu/subscriptions","organizations_url":"https://api.github.com/users/Coolthulhu/orgs","repos_url":"https://api.github.com/users/Coolthulhu/repos","events_url":"https://api.github.com/users/Coolthulhu/events{/privacy}","received_events_url":"https://api.github.com/users/Coolthulhu/received_events","type":"User","site_admin":false},"body":"From #7105 all the points except 3D explosions (and those will be very easy - more like enabling than implementing).\r\n\r\nI added a new flag to represent floor-less terrain: \"NO_FLOOR\". This will help later when water becomes 3D.\r\n\r\nAcid falls down, gases spread up and down when possible.\r\n\r\nFire is a tiny bit more complex:\r\n* Raging fires spread up if there is no floor or if the floor is flammable\r\n* Any fire hanging in the air will fall 1 density per turn, unless it has a raging fire below\r\n* Smoke is created above the tile that has a flame, or if the tile is not reachable, denser smoke is produced on the tile with the flame\r\n\r\nNumbers aren't perfectly balanced, I focused on functionality.\r\n\r\nAlso small adjustment to processing: when getting neighbors, 8 neighboring tiles always had their bounds checked. Here I changed it so that for tiles that aren't on the edge of the bubble, only 1 bounds check is performed for all 8 neighbors.","created_at":"2015-05-25T16:41:59Z","updated_at":"2015-05-26T05:28:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c1d3e7f4ac65dc1b777decd7251063be306d54f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/12463/commits","review_comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/12463/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/12463/comments","statuses_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/5e17fcd290438cc0253fa6077539430c812861e6","head":{"label":"Coolthulhu:full-3d-fields","ref":"full-3d-fields","sha":"5e17fcd290438cc0253fa6077539430c812861e6","user":{"login":"Coolthulhu","id":1878860,"avatar_url":"https://avatars.githubusercontent.com/u/1878860?v=3","gravatar_id":"","url":"https://api.github.com/users/Coolthulhu","html_url":"https://github.com/Coolthulhu","followers_url":"https://api.github.com/users/Coolthulhu/followers","following_url":"https://api.github.com/users/Coolthulhu/following{/other_user}","gists_url":"https://api.github.com/users/Coolthulhu/gists{/gist_id}","starred_url":"https://api.github.com/users/Coolthulhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Coolthulhu/subscriptions","organizations_url":"https://api.github.com/users/Coolthulhu/orgs","repos_url":"https://api.github.com/users/Coolthulhu/repos","events_url":"https://api.github.com/users/Coolthulhu/events{/privacy}","received_events_url":"https://api.github.com/users/Coolthulhu/received_events","type":"User","site_admin":false},"repo":{"id":23649904,"name":"Cataclysm-DDA","full_name":"Coolthulhu/Cataclysm-DDA","owner":{"login":"Coolthulhu","id":1878860,"avatar_url":"https://avatars.githubusercontent.com/u/1878860?v=3","gravatar_id":"","url":"https://api.github.com/users/Coolthulhu","html_url":"https://github.com/Coolthulhu","followers_url":"https://api.github.com/users/Coolthulhu/followers","following_url":"https://api.github.com/users/Coolthulhu/following{/other_user}","gists_url":"https://api.github.com/users/Coolthulhu/gists{/gist_id}","starred_url":"https://api.github.com/users/Coolthulhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Coolthulhu/subscriptions","organizations_url":"https://api.github.com/users/Coolthulhu/orgs","repos_url":"https://api.github.com/users/Coolthulhu/repos","events_url":"https://api.github.com/users/Coolthulhu/events{/privacy}","received_events_url":"https://api.github.com/users/Coolthulhu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Coolthulhu/Cataclysm-DDA","description":"Cataclysm - Dark Days Ahead. A fork/variant of Cataclysm Roguelike by Whales.","fork":true,"url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA","forks_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/forks","keys_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/teams","hooks_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/hooks","issue_events_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/issues/events{/number}","events_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/events","assignees_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/assignees{/user}","branches_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/branches{/branch}","tags_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/tags","blobs_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/git/refs{/sha}","trees_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/statuses/{sha}","languages_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/languages","stargazers_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/stargazers","contributors_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/contributors","subscribers_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/subscribers","subscription_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/subscription","commits_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/commits{/sha}","git_commits_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/git/commits{/sha}","comments_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/comments{/number}","issue_comment_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/issues/comments{/number}","contents_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/contents/{+path}","compare_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/merges","archive_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/downloads","issues_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/issues{/number}","pulls_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/pulls{/number}","milestones_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/milestones{/number}","notifications_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/labels{/name}","releases_url":"https://api.github.com/repos/Coolthulhu/Cataclysm-DDA/releases{/id}","created_at":"2014-09-04T05:39:34Z","updated_at":"2015-05-08T12:17:07Z","pushed_at":"2015-05-25T20:10:36Z","git_url":"git://github.com/Coolthulhu/Cataclysm-DDA.git","ssh_url":"git@github.com:Coolthulhu/Cataclysm-DDA.git","clone_url":"https://github.com/Coolthulhu/Cataclysm-DDA.git","svn_url":"https://github.com/Coolthulhu/Cataclysm-DDA","homepage":"http://en.cataclysmdda.com/","size":448212,"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":"57107d9e3406e1883c71e406bd347aa36700c5bb","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-05-25T21:41:53Z","pushed_at":"2015-05-25T20:13:05Z","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":542346,"stargazers_count":661,"watchers_count":661,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":704,"mirror_url":null,"open_issues_count":946,"forks":704,"open_issues":946,"watchers":661,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/12463"},"html":{"href":"https://github.com/CleverRaven/Cataclysm-DDA/pull/12463"},"issue":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/12463"},"comments":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/12463/comments"},"review_comments":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/12463/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/12463/commits"},"statuses":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/5e17fcd290438cc0253fa6077539430c812861e6"}}}}