{"action":"created","comment":{"url":"https://api.github.com/repos/FAForever/fa/pulls/comments/31386158","id":31386158,"diff_hunk":"@@ -38,21 +38,38 @@ end\n -- Gets the weapons of attackers, nil if not same units\n local function GetAttackerWeapons(forceReticle)\n     local attackers = GetSelectedUnits()\n-    local bp = nil\n+    local returnWeapons = nil\n \n     if attackers then\n+        local doneIds = {}\n+        local totalMaxRadius = 0\n         for i, u in attackers do\n             if forceReticle or EntityCategoryContains(categories.SHOWATTACKRETICLE, u) then\n-                if not bp then\n-                    bp = u:GetBlueprint()\n-                elseif bp.BlueprintId ~= u:GetBlueprint().BlueprintId then\n-                    return nil\n+                local bp = u:GetBlueprint()\n+                local Id = bp.BlueprintId\n+                if not doneIds.Id then\n+                    table.insert(doneIds, Id)","path":"lua/ui/controls/worldview.lua","position":19,"original_position":19,"commit_id":"dbe698895dae79c558fb4cd302f93b9233fb540d","original_commit_id":"dbe698895dae79c558fb4cd302f93b9233fb540d","user":{"login":"Crotalus","id":254972,"avatar_url":"https://avatars.githubusercontent.com/u/254972?v=3","gravatar_id":"","url":"https://api.github.com/users/Crotalus","html_url":"https://github.com/Crotalus","followers_url":"https://api.github.com/users/Crotalus/followers","following_url":"https://api.github.com/users/Crotalus/following{/other_user}","gists_url":"https://api.github.com/users/Crotalus/gists{/gist_id}","starred_url":"https://api.github.com/users/Crotalus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Crotalus/subscriptions","organizations_url":"https://api.github.com/users/Crotalus/orgs","repos_url":"https://api.github.com/users/Crotalus/repos","events_url":"https://api.github.com/users/Crotalus/events{/privacy}","received_events_url":"https://api.github.com/users/Crotalus/received_events","type":"User","site_admin":false},"body":"Yeah but your check `if not doneIds.Id` checks the doneIds-table for a key named 'Id' (same as if you would write `doneIds['Id']`, not the desired behavior you want. \r\n\r\nBy using the blueprint id as key and setting it to true you can check the table if the key exists with the suggested `doneIds[Id]`\r\n\r\nIf you just insert the blueprint ID's into the table you need to use table.find(doneIds, Id)` but this is more expensive.\r\n","created_at":"2015-05-31T02:19:33Z","updated_at":"2015-05-31T02:19:33Z","html_url":"https://github.com/FAForever/fa/pull/639#discussion_r31386158","pull_request_url":"https://api.github.com/repos/FAForever/fa/pulls/639","_links":{"self":{"href":"https://api.github.com/repos/FAForever/fa/pulls/comments/31386158"},"html":{"href":"https://github.com/FAForever/fa/pull/639#discussion_r31386158"},"pull_request":{"href":"https://api.github.com/repos/FAForever/fa/pulls/639"}}},"pull_request":{"url":"https://api.github.com/repos/FAForever/fa/pulls/639","id":36567422,"html_url":"https://github.com/FAForever/fa/pull/639","diff_url":"https://github.com/FAForever/fa/pull/639.diff","patch_url":"https://github.com/FAForever/fa/pull/639.patch","issue_url":"https://api.github.com/repos/FAForever/fa/issues/639","number":639,"state":"open","locked":false,"title":"Search attackers for the largest damage radius","user":{"login":"aeoncleanse","id":8494967,"avatar_url":"https://avatars.githubusercontent.com/u/8494967?v=3","gravatar_id":"","url":"https://api.github.com/users/aeoncleanse","html_url":"https://github.com/aeoncleanse","followers_url":"https://api.github.com/users/aeoncleanse/followers","following_url":"https://api.github.com/users/aeoncleanse/following{/other_user}","gists_url":"https://api.github.com/users/aeoncleanse/gists{/gist_id}","starred_url":"https://api.github.com/users/aeoncleanse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aeoncleanse/subscriptions","organizations_url":"https://api.github.com/users/aeoncleanse/orgs","repos_url":"https://api.github.com/users/aeoncleanse/repos","events_url":"https://api.github.com/users/aeoncleanse/events{/privacy}","received_events_url":"https://api.github.com/users/aeoncleanse/received_events","type":"User","site_admin":false},"body":"Fixes #627 ","created_at":"2015-05-30T15:48:30Z","updated_at":"2015-05-31T02:19:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59363776c571bfc502f0f3c94146624d62d503a3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/FAForever/fa/pulls/639/commits","review_comments_url":"https://api.github.com/repos/FAForever/fa/pulls/639/comments","review_comment_url":"https://api.github.com/repos/FAForever/fa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FAForever/fa/issues/639/comments","statuses_url":"https://api.github.com/repos/FAForever/fa/statuses/dbe698895dae79c558fb4cd302f93b9233fb540d","head":{"label":"aeoncleanse:fixtargetreticles","ref":"fixtargetreticles","sha":"dbe698895dae79c558fb4cd302f93b9233fb540d","user":{"login":"aeoncleanse","id":8494967,"avatar_url":"https://avatars.githubusercontent.com/u/8494967?v=3","gravatar_id":"","url":"https://api.github.com/users/aeoncleanse","html_url":"https://github.com/aeoncleanse","followers_url":"https://api.github.com/users/aeoncleanse/followers","following_url":"https://api.github.com/users/aeoncleanse/following{/other_user}","gists_url":"https://api.github.com/users/aeoncleanse/gists{/gist_id}","starred_url":"https://api.github.com/users/aeoncleanse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aeoncleanse/subscriptions","organizations_url":"https://api.github.com/users/aeoncleanse/orgs","repos_url":"https://api.github.com/users/aeoncleanse/repos","events_url":"https://api.github.com/users/aeoncleanse/events{/privacy}","received_events_url":"https://api.github.com/users/aeoncleanse/received_events","type":"User","site_admin":false},"repo":{"id":25368939,"name":"fa","full_name":"aeoncleanse/fa","owner":{"login":"aeoncleanse","id":8494967,"avatar_url":"https://avatars.githubusercontent.com/u/8494967?v=3","gravatar_id":"","url":"https://api.github.com/users/aeoncleanse","html_url":"https://github.com/aeoncleanse","followers_url":"https://api.github.com/users/aeoncleanse/followers","following_url":"https://api.github.com/users/aeoncleanse/following{/other_user}","gists_url":"https://api.github.com/users/aeoncleanse/gists{/gist_id}","starred_url":"https://api.github.com/users/aeoncleanse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aeoncleanse/subscriptions","organizations_url":"https://api.github.com/users/aeoncleanse/orgs","repos_url":"https://api.github.com/users/aeoncleanse/repos","events_url":"https://api.github.com/users/aeoncleanse/events{/privacy}","received_events_url":"https://api.github.com/users/aeoncleanse/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aeoncleanse/fa","description":"Lua code for FAF","fork":true,"url":"https://api.github.com/repos/aeoncleanse/fa","forks_url":"https://api.github.com/repos/aeoncleanse/fa/forks","keys_url":"https://api.github.com/repos/aeoncleanse/fa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aeoncleanse/fa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aeoncleanse/fa/teams","hooks_url":"https://api.github.com/repos/aeoncleanse/fa/hooks","issue_events_url":"https://api.github.com/repos/aeoncleanse/fa/issues/events{/number}","events_url":"https://api.github.com/repos/aeoncleanse/fa/events","assignees_url":"https://api.github.com/repos/aeoncleanse/fa/assignees{/user}","branches_url":"https://api.github.com/repos/aeoncleanse/fa/branches{/branch}","tags_url":"https://api.github.com/repos/aeoncleanse/fa/tags","blobs_url":"https://api.github.com/repos/aeoncleanse/fa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aeoncleanse/fa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aeoncleanse/fa/git/refs{/sha}","trees_url":"https://api.github.com/repos/aeoncleanse/fa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aeoncleanse/fa/statuses/{sha}","languages_url":"https://api.github.com/repos/aeoncleanse/fa/languages","stargazers_url":"https://api.github.com/repos/aeoncleanse/fa/stargazers","contributors_url":"https://api.github.com/repos/aeoncleanse/fa/contributors","subscribers_url":"https://api.github.com/repos/aeoncleanse/fa/subscribers","subscription_url":"https://api.github.com/repos/aeoncleanse/fa/subscription","commits_url":"https://api.github.com/repos/aeoncleanse/fa/commits{/sha}","git_commits_url":"https://api.github.com/repos/aeoncleanse/fa/git/commits{/sha}","comments_url":"https://api.github.com/repos/aeoncleanse/fa/comments{/number}","issue_comment_url":"https://api.github.com/repos/aeoncleanse/fa/issues/comments{/number}","contents_url":"https://api.github.com/repos/aeoncleanse/fa/contents/{+path}","compare_url":"https://api.github.com/repos/aeoncleanse/fa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aeoncleanse/fa/merges","archive_url":"https://api.github.com/repos/aeoncleanse/fa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aeoncleanse/fa/downloads","issues_url":"https://api.github.com/repos/aeoncleanse/fa/issues{/number}","pulls_url":"https://api.github.com/repos/aeoncleanse/fa/pulls{/number}","milestones_url":"https://api.github.com/repos/aeoncleanse/fa/milestones{/number}","notifications_url":"https://api.github.com/repos/aeoncleanse/fa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aeoncleanse/fa/labels{/name}","releases_url":"https://api.github.com/repos/aeoncleanse/fa/releases{/id}","created_at":"2014-10-17T17:21:41Z","updated_at":"2015-03-01T17:57:19Z","pushed_at":"2015-05-30T15:47:32Z","git_url":"git://github.com/aeoncleanse/fa.git","ssh_url":"git@github.com:aeoncleanse/fa.git","clone_url":"https://github.com/aeoncleanse/fa.git","svn_url":"https://github.com/aeoncleanse/fa","homepage":"","size":105823,"stargazers_count":0,"watchers_count":0,"language":"Lua","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":"develop"}},"base":{"label":"FAForever:release/3641","ref":"release/3641","sha":"6dca0c30ffad86c60e29ef4c62eb729edb244db7","user":{"login":"FAForever","id":8887184,"avatar_url":"https://avatars.githubusercontent.com/u/8887184?v=3","gravatar_id":"","url":"https://api.github.com/users/FAForever","html_url":"https://github.com/FAForever","followers_url":"https://api.github.com/users/FAForever/followers","following_url":"https://api.github.com/users/FAForever/following{/other_user}","gists_url":"https://api.github.com/users/FAForever/gists{/gist_id}","starred_url":"https://api.github.com/users/FAForever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FAForever/subscriptions","organizations_url":"https://api.github.com/users/FAForever/orgs","repos_url":"https://api.github.com/users/FAForever/repos","events_url":"https://api.github.com/users/FAForever/events{/privacy}","received_events_url":"https://api.github.com/users/FAForever/received_events","type":"Organization","site_admin":false},"repo":{"id":24403473,"name":"fa","full_name":"FAForever/fa","owner":{"login":"FAForever","id":8887184,"avatar_url":"https://avatars.githubusercontent.com/u/8887184?v=3","gravatar_id":"","url":"https://api.github.com/users/FAForever","html_url":"https://github.com/FAForever","followers_url":"https://api.github.com/users/FAForever/followers","following_url":"https://api.github.com/users/FAForever/following{/other_user}","gists_url":"https://api.github.com/users/FAForever/gists{/gist_id}","starred_url":"https://api.github.com/users/FAForever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FAForever/subscriptions","organizations_url":"https://api.github.com/users/FAForever/orgs","repos_url":"https://api.github.com/users/FAForever/repos","events_url":"https://api.github.com/users/FAForever/events{/privacy}","received_events_url":"https://api.github.com/users/FAForever/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FAForever/fa","description":"Lua code for FAF","fork":false,"url":"https://api.github.com/repos/FAForever/fa","forks_url":"https://api.github.com/repos/FAForever/fa/forks","keys_url":"https://api.github.com/repos/FAForever/fa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FAForever/fa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FAForever/fa/teams","hooks_url":"https://api.github.com/repos/FAForever/fa/hooks","issue_events_url":"https://api.github.com/repos/FAForever/fa/issues/events{/number}","events_url":"https://api.github.com/repos/FAForever/fa/events","assignees_url":"https://api.github.com/repos/FAForever/fa/assignees{/user}","branches_url":"https://api.github.com/repos/FAForever/fa/branches{/branch}","tags_url":"https://api.github.com/repos/FAForever/fa/tags","blobs_url":"https://api.github.com/repos/FAForever/fa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FAForever/fa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FAForever/fa/git/refs{/sha}","trees_url":"https://api.github.com/repos/FAForever/fa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FAForever/fa/statuses/{sha}","languages_url":"https://api.github.com/repos/FAForever/fa/languages","stargazers_url":"https://api.github.com/repos/FAForever/fa/stargazers","contributors_url":"https://api.github.com/repos/FAForever/fa/contributors","subscribers_url":"https://api.github.com/repos/FAForever/fa/subscribers","subscription_url":"https://api.github.com/repos/FAForever/fa/subscription","commits_url":"https://api.github.com/repos/FAForever/fa/commits{/sha}","git_commits_url":"https://api.github.com/repos/FAForever/fa/git/commits{/sha}","comments_url":"https://api.github.com/repos/FAForever/fa/comments{/number}","issue_comment_url":"https://api.github.com/repos/FAForever/fa/issues/comments{/number}","contents_url":"https://api.github.com/repos/FAForever/fa/contents/{+path}","compare_url":"https://api.github.com/repos/FAForever/fa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FAForever/fa/merges","archive_url":"https://api.github.com/repos/FAForever/fa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FAForever/fa/downloads","issues_url":"https://api.github.com/repos/FAForever/fa/issues{/number}","pulls_url":"https://api.github.com/repos/FAForever/fa/pulls{/number}","milestones_url":"https://api.github.com/repos/FAForever/fa/milestones{/number}","notifications_url":"https://api.github.com/repos/FAForever/fa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FAForever/fa/labels{/name}","releases_url":"https://api.github.com/repos/FAForever/fa/releases{/id}","created_at":"2014-09-24T06:34:12Z","updated_at":"2015-05-08T00:31:11Z","pushed_at":"2015-05-30T15:48:30Z","git_url":"git://github.com/FAForever/fa.git","ssh_url":"git@github.com:FAForever/fa.git","clone_url":"https://github.com/FAForever/fa.git","svn_url":"https://github.com/FAForever/fa","homepage":"","size":117670,"stargazers_count":16,"watchers_count":16,"language":"Lua","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":104,"forks":22,"open_issues":104,"watchers":16,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/FAForever/fa/pulls/639"},"html":{"href":"https://github.com/FAForever/fa/pull/639"},"issue":{"href":"https://api.github.com/repos/FAForever/fa/issues/639"},"comments":{"href":"https://api.github.com/repos/FAForever/fa/issues/639/comments"},"review_comments":{"href":"https://api.github.com/repos/FAForever/fa/pulls/639/comments"},"review_comment":{"href":"https://api.github.com/repos/FAForever/fa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FAForever/fa/pulls/639/commits"},"statuses":{"href":"https://api.github.com/repos/FAForever/fa/statuses/dbe698895dae79c558fb4cd302f93b9233fb540d"}}}}