{"action":"created","comment":{"url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/comments/23884837","id":23884837,"diff_hunk":"@@ -10674,8 +10674,14 @@ exports.BattleMovedex = {\n \t\t\t\t\t// Run through each decision in queue to check if the Pursuit user is supposed to mega evolve this turn.\n \t\t\t\t\t// If it is, then mega evolve before moving.\n \t\t\t\t\tvar willMegaEvo = false;\n-\t\t\t\t\tfor (var j = 0; j < this.queue.length; j++) {\n-\t\t\t\t\t\tif (this.queue[j].pokemon === sources[i] && this.queue[j].choice === 'megaEvo') willMegaEvo = true;\n+\t\t\t\t\tif (sources[i].canMegaEvo) {\n+\t\t\t\t\t\tfor (var j = 0; j < this.queue.length; j++) {\n+\t\t\t\t\t\t\tif (this.queue[j].pokemon === sources[i] && this.queue[j].choice === 'megaEvo') {\n+\t\t\t\t\t\t\t\tthis.queue.splice(j, 1);\n+\t\t\t\t\t\t\t\twillMegaEvo = true;\n+\t\t\t\t\t\t\t\tbreak;\n+\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tif (willMegaEvo) this.runMegaEvo(sources[i]);","path":"data/moves.js","position":15,"original_position":15,"commit_id":"adff1c0390346d5c55550411372a54511b69d589","original_commit_id":"adff1c0390346d5c55550411372a54511b69d589","user":{"login":"Zarel","id":551184,"avatar_url":"https://avatars.githubusercontent.com/u/551184?v=3","gravatar_id":"","url":"https://api.github.com/users/Zarel","html_url":"https://github.com/Zarel","followers_url":"https://api.github.com/users/Zarel/followers","following_url":"https://api.github.com/users/Zarel/following{/other_user}","gists_url":"https://api.github.com/users/Zarel/gists{/gist_id}","starred_url":"https://api.github.com/users/Zarel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zarel/subscriptions","organizations_url":"https://api.github.com/users/Zarel/orgs","repos_url":"https://api.github.com/users/Zarel/repos","events_url":"https://api.github.com/users/Zarel/events{/privacy}","received_events_url":"https://api.github.com/users/Zarel/received_events","type":"User","site_admin":false},"body":"We can just replace `willMegaEvo = true;` with `this.runMegaEvo(sources[i]);` and save ourselves a flag variable.","created_at":"2015-01-31T01:38:29Z","updated_at":"2015-01-31T01:38:29Z","html_url":"https://github.com/Zarel/Pokemon-Showdown/pull/1487#discussion_r23884837","pull_request_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/1487","_links":{"self":{"href":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/comments/23884837"},"html":{"href":"https://github.com/Zarel/Pokemon-Showdown/pull/1487#discussion_r23884837"},"pull_request":{"href":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/1487"}}},"pull_request":{"url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/1487","id":28402343,"html_url":"https://github.com/Zarel/Pokemon-Showdown/pull/1487","diff_url":"https://github.com/Zarel/Pokemon-Showdown/pull/1487.diff","patch_url":"https://github.com/Zarel/Pokemon-Showdown/pull/1487.patch","issue_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues/1487","number":1487,"state":"open","locked":false,"title":"Pokémon cannot megaevolve to themselves","user":{"login":"Slayer95","id":4925744,"avatar_url":"https://avatars.githubusercontent.com/u/4925744?v=3","gravatar_id":"","url":"https://api.github.com/users/Slayer95","html_url":"https://github.com/Slayer95","followers_url":"https://api.github.com/users/Slayer95/followers","following_url":"https://api.github.com/users/Slayer95/following{/other_user}","gists_url":"https://api.github.com/users/Slayer95/gists{/gist_id}","starred_url":"https://api.github.com/users/Slayer95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Slayer95/subscriptions","organizations_url":"https://api.github.com/users/Slayer95/orgs","repos_url":"https://api.github.com/users/Slayer95/repos","events_url":"https://api.github.com/users/Slayer95/events{/privacy}","received_events_url":"https://api.github.com/users/Slayer95/received_events","type":"User","site_admin":false},"body":"- Rename randbats helper function `canMegaEvo` to `hasMegaEvo`.\r\n- Move duplicate mega evolution possibility checks from `runMegaEvo` and BattlePokemon constructor to `canMegaEvo` battle script.","created_at":"2015-01-30T23:31:59Z","updated_at":"2015-01-31T01:38:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9cbdee9812dfe7a9edf4c2db21f5936d6b143b55","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/1487/commits","review_comments_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/1487/comments","review_comment_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues/1487/comments","statuses_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/statuses/adff1c0390346d5c55550411372a54511b69d589","head":{"label":"Slayer95:mega-evolution","ref":"mega-evolution","sha":"adff1c0390346d5c55550411372a54511b69d589","user":{"login":"Slayer95","id":4925744,"avatar_url":"https://avatars.githubusercontent.com/u/4925744?v=3","gravatar_id":"","url":"https://api.github.com/users/Slayer95","html_url":"https://github.com/Slayer95","followers_url":"https://api.github.com/users/Slayer95/followers","following_url":"https://api.github.com/users/Slayer95/following{/other_user}","gists_url":"https://api.github.com/users/Slayer95/gists{/gist_id}","starred_url":"https://api.github.com/users/Slayer95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Slayer95/subscriptions","organizations_url":"https://api.github.com/users/Slayer95/orgs","repos_url":"https://api.github.com/users/Slayer95/repos","events_url":"https://api.github.com/users/Slayer95/events{/privacy}","received_events_url":"https://api.github.com/users/Slayer95/received_events","type":"User","site_admin":false},"repo":{"id":17419040,"name":"Pokemon-Showdown","full_name":"Slayer95/Pokemon-Showdown","owner":{"login":"Slayer95","id":4925744,"avatar_url":"https://avatars.githubusercontent.com/u/4925744?v=3","gravatar_id":"","url":"https://api.github.com/users/Slayer95","html_url":"https://github.com/Slayer95","followers_url":"https://api.github.com/users/Slayer95/followers","following_url":"https://api.github.com/users/Slayer95/following{/other_user}","gists_url":"https://api.github.com/users/Slayer95/gists{/gist_id}","starred_url":"https://api.github.com/users/Slayer95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Slayer95/subscriptions","organizations_url":"https://api.github.com/users/Slayer95/orgs","repos_url":"https://api.github.com/users/Slayer95/repos","events_url":"https://api.github.com/users/Slayer95/events{/privacy}","received_events_url":"https://api.github.com/users/Slayer95/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Slayer95/Pokemon-Showdown","description":"Pokémon battle simulator.","fork":true,"url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown","forks_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/forks","keys_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/teams","hooks_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/hooks","issue_events_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/issues/events{/number}","events_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/events","assignees_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/assignees{/user}","branches_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/branches{/branch}","tags_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/tags","blobs_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/git/refs{/sha}","trees_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/statuses/{sha}","languages_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/languages","stargazers_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/stargazers","contributors_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/contributors","subscribers_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/subscribers","subscription_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/subscription","commits_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/commits{/sha}","git_commits_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/git/commits{/sha}","comments_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/comments{/number}","issue_comment_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/issues/comments/{number}","contents_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/contents/{+path}","compare_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/merges","archive_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/downloads","issues_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/issues{/number}","pulls_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/pulls{/number}","milestones_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/milestones{/number}","notifications_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/labels{/name}","releases_url":"https://api.github.com/repos/Slayer95/Pokemon-Showdown/releases{/id}","created_at":"2014-03-04T22:07:24Z","updated_at":"2015-01-28T04:39:40Z","pushed_at":"2015-01-31T00:01:20Z","git_url":"git://github.com/Slayer95/Pokemon-Showdown.git","ssh_url":"git@github.com:Slayer95/Pokemon-Showdown.git","clone_url":"https://github.com/Slayer95/Pokemon-Showdown.git","svn_url":"https://github.com/Slayer95/Pokemon-Showdown","homepage":"http://pokemonshowdown.com","size":30479,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"Zarel:master","ref":"master","sha":"13ab79f0f96212f3ed97d8a4248708f29e5b6883","user":{"login":"Zarel","id":551184,"avatar_url":"https://avatars.githubusercontent.com/u/551184?v=3","gravatar_id":"","url":"https://api.github.com/users/Zarel","html_url":"https://github.com/Zarel","followers_url":"https://api.github.com/users/Zarel/followers","following_url":"https://api.github.com/users/Zarel/following{/other_user}","gists_url":"https://api.github.com/users/Zarel/gists{/gist_id}","starred_url":"https://api.github.com/users/Zarel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zarel/subscriptions","organizations_url":"https://api.github.com/users/Zarel/orgs","repos_url":"https://api.github.com/users/Zarel/repos","events_url":"https://api.github.com/users/Zarel/events{/privacy}","received_events_url":"https://api.github.com/users/Zarel/received_events","type":"User","site_admin":false},"repo":{"id":3038446,"name":"Pokemon-Showdown","full_name":"Zarel/Pokemon-Showdown","owner":{"login":"Zarel","id":551184,"avatar_url":"https://avatars.githubusercontent.com/u/551184?v=3","gravatar_id":"","url":"https://api.github.com/users/Zarel","html_url":"https://github.com/Zarel","followers_url":"https://api.github.com/users/Zarel/followers","following_url":"https://api.github.com/users/Zarel/following{/other_user}","gists_url":"https://api.github.com/users/Zarel/gists{/gist_id}","starred_url":"https://api.github.com/users/Zarel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zarel/subscriptions","organizations_url":"https://api.github.com/users/Zarel/orgs","repos_url":"https://api.github.com/users/Zarel/repos","events_url":"https://api.github.com/users/Zarel/events{/privacy}","received_events_url":"https://api.github.com/users/Zarel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Zarel/Pokemon-Showdown","description":"Pokémon battle simulator.","fork":false,"url":"https://api.github.com/repos/Zarel/Pokemon-Showdown","forks_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/forks","keys_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/teams","hooks_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/hooks","issue_events_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues/events{/number}","events_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/events","assignees_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/assignees{/user}","branches_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/branches{/branch}","tags_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/tags","blobs_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/git/refs{/sha}","trees_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/statuses/{sha}","languages_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/languages","stargazers_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/stargazers","contributors_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/contributors","subscribers_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/subscribers","subscription_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/subscription","commits_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/commits{/sha}","git_commits_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/git/commits{/sha}","comments_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/comments{/number}","issue_comment_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues/comments/{number}","contents_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/contents/{+path}","compare_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/merges","archive_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/downloads","issues_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues{/number}","pulls_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls{/number}","milestones_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/milestones{/number}","notifications_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/labels{/name}","releases_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/releases{/id}","created_at":"2011-12-23T04:52:33Z","updated_at":"2015-01-31T00:50:14Z","pushed_at":"2015-01-31T00:50:14Z","git_url":"git://github.com/Zarel/Pokemon-Showdown.git","ssh_url":"git@github.com:Zarel/Pokemon-Showdown.git","clone_url":"https://github.com/Zarel/Pokemon-Showdown.git","svn_url":"https://github.com/Zarel/Pokemon-Showdown","homepage":"http://pokemonshowdown.com","size":56226,"stargazers_count":445,"watchers_count":445,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":588,"mirror_url":null,"open_issues_count":29,"forks":588,"open_issues":29,"watchers":445,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/1487"},"html":{"href":"https://github.com/Zarel/Pokemon-Showdown/pull/1487"},"issue":{"href":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues/1487"},"comments":{"href":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues/1487/comments"},"review_comments":{"href":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/1487/comments"},"review_comment":{"href":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/1487/commits"},"statuses":{"href":"https://api.github.com/repos/Zarel/Pokemon-Showdown/statuses/adff1c0390346d5c55550411372a54511b69d589"}}}}