{"action":"created","comment":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments/85647777","pull_request_review_id":6353645,"id":85647777,"diff_hunk":"@@ -341,29 +424,52 @@ dealt_projectile_attack Creature::projectile_attack( const projectile &proj_arg,\n     return attack;\n }\n \n+static double erfinv( double x )\n+{\n+    const double epsilon = 1e-6;\n+    double z = 0.0;\n+\n+    // find erf(z) - x = 0\n+    // d/dz ( erf(z) - x ) = 2/sqrt(pi) . e^(-z^2)\n+\n+    for( int n = 0; n < 10; ++n ) {\n+        double step = ( std::erf( z ) - x ) / ( M_2_SQRTPI * exp( -z * z ) );\n+        z -= step;\n+        if( std::abs( step ) < epsilon )\n+            break;\n+    }\n+\n+    return z;\n+}\n+\n double player::gun_current_range( const item& gun, double penalty, unsigned chance, double accuracy ) const\n {\n     if( !gun.is_gun() || !gun.ammo_sufficient() ) {\n         return 0;\n     }\n \n+    double max_range = gun.gun_range( this );\n+\n     if( chance == 0 ) {\n-        return gun.gun_range( this );\n+        return max_range;","path":"src/ranged.cpp","position":192,"original_position":192,"commit_id":"309a165c0709f31cc413d1915eb2786524e5dc47","original_commit_id":"309a165c0709f31cc413d1915eb2786524e5dc47","user":{"login":"mutability","id":3055062,"avatar_url":"https://avatars.githubusercontent.com/u/3055062?v=3","gravatar_id":"","url":"https://api.github.com/users/mutability","html_url":"https://github.com/mutability","followers_url":"https://api.github.com/users/mutability/followers","following_url":"https://api.github.com/users/mutability/following{/other_user}","gists_url":"https://api.github.com/users/mutability/gists{/gist_id}","starred_url":"https://api.github.com/users/mutability/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mutability/subscriptions","organizations_url":"https://api.github.com/users/mutability/orgs","repos_url":"https://api.github.com/users/mutability/repos","events_url":"https://api.github.com/users/mutability/events{/privacy}","received_events_url":"https://api.github.com/users/mutability/received_events","type":"User","site_admin":false},"body":"OK, fair enough, the paths are independent.","created_at":"2016-10-29T20:29:52Z","updated_at":"2016-10-29T20:29:52Z","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/19019#discussion_r85647777","pull_request_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/19019","_links":{"self":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments/85647777"},"html":{"href":"https://github.com/CleverRaven/Cataclysm-DDA/pull/19019#discussion_r85647777"},"pull_request":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/19019"}}},"pull_request":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/19019","id":91499343,"html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/19019","diff_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/19019.diff","patch_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/19019.patch","issue_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/19019","number":19019,"state":"open","locked":false,"title":"[WIP] Dispersion round 2","user":{"login":"mutability","id":3055062,"avatar_url":"https://avatars.githubusercontent.com/u/3055062?v=3","gravatar_id":"","url":"https://api.github.com/users/mutability","html_url":"https://github.com/mutability","followers_url":"https://api.github.com/users/mutability/followers","following_url":"https://api.github.com/users/mutability/following{/other_user}","gists_url":"https://api.github.com/users/mutability/gists{/gist_id}","starred_url":"https://api.github.com/users/mutability/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mutability/subscriptions","organizations_url":"https://api.github.com/users/mutability/orgs","repos_url":"https://api.github.com/users/mutability/repos","events_url":"https://api.github.com/users/mutability/events{/privacy}","received_events_url":"https://api.github.com/users/mutability/received_events","type":"User","site_admin":false},"body":"@mugling: Here's the PR you wanted. What are the things you want to see before you would accept this?","created_at":"2016-10-29T19:30:55Z","updated_at":"2016-10-29T20:29:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aebcda89656029d43e0d2e658743b14d93698b7f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/19019/commits","review_comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/19019/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/19019/comments","statuses_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/309a165c0709f31cc413d1915eb2786524e5dc47","head":{"label":"mutability:dispersion-round-2","ref":"dispersion-round-2","sha":"309a165c0709f31cc413d1915eb2786524e5dc47","user":{"login":"mutability","id":3055062,"avatar_url":"https://avatars.githubusercontent.com/u/3055062?v=3","gravatar_id":"","url":"https://api.github.com/users/mutability","html_url":"https://github.com/mutability","followers_url":"https://api.github.com/users/mutability/followers","following_url":"https://api.github.com/users/mutability/following{/other_user}","gists_url":"https://api.github.com/users/mutability/gists{/gist_id}","starred_url":"https://api.github.com/users/mutability/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mutability/subscriptions","organizations_url":"https://api.github.com/users/mutability/orgs","repos_url":"https://api.github.com/users/mutability/repos","events_url":"https://api.github.com/users/mutability/events{/privacy}","received_events_url":"https://api.github.com/users/mutability/received_events","type":"User","site_admin":false},"repo":{"id":46669680,"name":"Cataclysm-DDA","full_name":"mutability/Cataclysm-DDA","owner":{"login":"mutability","id":3055062,"avatar_url":"https://avatars.githubusercontent.com/u/3055062?v=3","gravatar_id":"","url":"https://api.github.com/users/mutability","html_url":"https://github.com/mutability","followers_url":"https://api.github.com/users/mutability/followers","following_url":"https://api.github.com/users/mutability/following{/other_user}","gists_url":"https://api.github.com/users/mutability/gists{/gist_id}","starred_url":"https://api.github.com/users/mutability/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mutability/subscriptions","organizations_url":"https://api.github.com/users/mutability/orgs","repos_url":"https://api.github.com/users/mutability/repos","events_url":"https://api.github.com/users/mutability/events{/privacy}","received_events_url":"https://api.github.com/users/mutability/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mutability/Cataclysm-DDA","description":"Cataclysm - Dark Days Ahead. A fork/variant of Cataclysm Roguelike by Whales.","fork":true,"url":"https://api.github.com/repos/mutability/Cataclysm-DDA","forks_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/forks","keys_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/teams","hooks_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/hooks","issue_events_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/issues/events{/number}","events_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/events","assignees_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/assignees{/user}","branches_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/branches{/branch}","tags_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/tags","blobs_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/git/refs{/sha}","trees_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/statuses/{sha}","languages_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/languages","stargazers_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/stargazers","contributors_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/contributors","subscribers_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/subscribers","subscription_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/subscription","commits_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/commits{/sha}","git_commits_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/git/commits{/sha}","comments_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/comments{/number}","issue_comment_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/issues/comments{/number}","contents_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/contents/{+path}","compare_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/merges","archive_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/downloads","issues_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/issues{/number}","pulls_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/pulls{/number}","milestones_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/milestones{/number}","notifications_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/labels{/name}","releases_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/releases{/id}","deployments_url":"https://api.github.com/repos/mutability/Cataclysm-DDA/deployments","created_at":"2015-11-22T16:46:54Z","updated_at":"2016-10-28T18:23:23Z","pushed_at":"2016-10-29T19:30:21Z","git_url":"git://github.com/mutability/Cataclysm-DDA.git","ssh_url":"git@github.com:mutability/Cataclysm-DDA.git","clone_url":"https://github.com/mutability/Cataclysm-DDA.git","svn_url":"https://github.com/mutability/Cataclysm-DDA","homepage":"http://en.cataclysmdda.com/","size":810458,"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":"9d41e9fd4a4c453b799faa43a60d469295cf8eff","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-10-28T13:42:05Z","pushed_at":"2016-10-29T19:30:55Z","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":1089493,"stargazers_count":1126,"watchers_count":1126,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":977,"mirror_url":null,"open_issues_count":1324,"forks":977,"open_issues":1324,"watchers":1126,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/19019"},"html":{"href":"https://github.com/CleverRaven/Cataclysm-DDA/pull/19019"},"issue":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/19019"},"comments":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/19019/comments"},"review_comments":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/19019/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/19019/commits"},"statuses":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/309a165c0709f31cc413d1915eb2786524e5dc47"}}}}
{"actor":{"display_login":"mutability"}}