{"action":"created","comment":{"url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments/38572232","id":38572232,"diff_hunk":"@@ -984,7 +987,11 @@ void BuildUnit(string category, bool buildRandom)\n \t\t\t\tChooseRandomUnitToBuild(queue) :\n \t\t\t\tChooseUnitToBuild(queue);\n \n-\t\t\tif (unit != null && Info.UnitsToBuild.Any(u => u.Key == unit.Name))\n+\t\t\tif (unit != null\n+\t\t\t\t&& Info.UnitsToBuild.ContainsKey(unit.Name)\n+\t\t\t\t&& (!Info.UnitLimits.ContainsKey(unit.Name)\n+\t\t\t\t\t|| World.Actors.Count(a => a.Info.Name == unit.Name && a.Owner == Player) < Info.UnitLimits[unit.Name]))","path":"OpenRA.Mods.Common/AI/HackyAI.cs","position":27,"original_position":27,"commit_id":"11c5144cb490a5e14c9b43ce1404db5cfdd5bdd6","original_commit_id":"11c5144cb490a5e14c9b43ce1404db5cfdd5bdd6","user":{"login":"Mailaender","id":756669,"avatar_url":"https://avatars.githubusercontent.com/u/756669?v=3","gravatar_id":"","url":"https://api.github.com/users/Mailaender","html_url":"https://github.com/Mailaender","followers_url":"https://api.github.com/users/Mailaender/followers","following_url":"https://api.github.com/users/Mailaender/following{/other_user}","gists_url":"https://api.github.com/users/Mailaender/gists{/gist_id}","starred_url":"https://api.github.com/users/Mailaender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mailaender/subscriptions","organizations_url":"https://api.github.com/users/Mailaender/orgs","repos_url":"https://api.github.com/users/Mailaender/repos","events_url":"https://api.github.com/users/Mailaender/events{/privacy}","received_events_url":"https://api.github.com/users/Mailaender/received_events","type":"User","site_admin":false},"body":"Sorry I did not see your comment while I was testing this in practice.","created_at":"2015-09-02T19:14:48Z","updated_at":"2015-09-02T19:14:48Z","html_url":"https://github.com/OpenRA/OpenRA/pull/9222#discussion_r38572232","pull_request_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/9222","_links":{"self":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments/38572232"},"html":{"href":"https://github.com/OpenRA/OpenRA/pull/9222#discussion_r38572232"},"pull_request":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/9222"}}},"pull_request":{"url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/9222","id":43903757,"html_url":"https://github.com/OpenRA/OpenRA/pull/9222","diff_url":"https://github.com/OpenRA/OpenRA/pull/9222.diff","patch_url":"https://github.com/OpenRA/OpenRA/pull/9222.patch","issue_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/9222","number":9222,"state":"closed","locked":false,"title":" Implement HackyAI->UnitLimits.","user":{"login":"GraionDilach","id":1136302,"avatar_url":"https://avatars.githubusercontent.com/u/1136302?v=3","gravatar_id":"","url":"https://api.github.com/users/GraionDilach","html_url":"https://github.com/GraionDilach","followers_url":"https://api.github.com/users/GraionDilach/followers","following_url":"https://api.github.com/users/GraionDilach/following{/other_user}","gists_url":"https://api.github.com/users/GraionDilach/gists{/gist_id}","starred_url":"https://api.github.com/users/GraionDilach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GraionDilach/subscriptions","organizations_url":"https://api.github.com/users/GraionDilach/orgs","repos_url":"https://api.github.com/users/GraionDilach/repos","events_url":"https://api.github.com/users/GraionDilach/events{/privacy}","received_events_url":"https://api.github.com/users/GraionDilach/received_events","type":"User","site_admin":false},"body":"Fixes #8823.\r\nFixes #6695.","created_at":"2015-09-01T17:32:42Z","updated_at":"2015-09-02T19:14:49Z","closed_at":"2015-09-02T19:14:13Z","merged_at":"2015-09-02T19:14:13Z","merge_commit_sha":"a198949fd0aa360ff8600cf114e02a2147afb67f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/9222/commits","review_comments_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/9222/comments","review_comment_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/9222/comments","statuses_url":"https://api.github.com/repos/OpenRA/OpenRA/statuses/11c5144cb490a5e14c9b43ce1404db5cfdd5bdd6","head":{"label":"GraionDilach:hackyai-unitlimits","ref":"hackyai-unitlimits","sha":"11c5144cb490a5e14c9b43ce1404db5cfdd5bdd6","user":{"login":"GraionDilach","id":1136302,"avatar_url":"https://avatars.githubusercontent.com/u/1136302?v=3","gravatar_id":"","url":"https://api.github.com/users/GraionDilach","html_url":"https://github.com/GraionDilach","followers_url":"https://api.github.com/users/GraionDilach/followers","following_url":"https://api.github.com/users/GraionDilach/following{/other_user}","gists_url":"https://api.github.com/users/GraionDilach/gists{/gist_id}","starred_url":"https://api.github.com/users/GraionDilach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GraionDilach/subscriptions","organizations_url":"https://api.github.com/users/GraionDilach/orgs","repos_url":"https://api.github.com/users/GraionDilach/repos","events_url":"https://api.github.com/users/GraionDilach/events{/privacy}","received_events_url":"https://api.github.com/users/GraionDilach/received_events","type":"User","site_admin":false},"repo":{"id":31671344,"name":"OpenRA","full_name":"GraionDilach/OpenRA","owner":{"login":"GraionDilach","id":1136302,"avatar_url":"https://avatars.githubusercontent.com/u/1136302?v=3","gravatar_id":"","url":"https://api.github.com/users/GraionDilach","html_url":"https://github.com/GraionDilach","followers_url":"https://api.github.com/users/GraionDilach/followers","following_url":"https://api.github.com/users/GraionDilach/following{/other_user}","gists_url":"https://api.github.com/users/GraionDilach/gists{/gist_id}","starred_url":"https://api.github.com/users/GraionDilach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GraionDilach/subscriptions","organizations_url":"https://api.github.com/users/GraionDilach/orgs","repos_url":"https://api.github.com/users/GraionDilach/repos","events_url":"https://api.github.com/users/GraionDilach/events{/privacy}","received_events_url":"https://api.github.com/users/GraionDilach/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/GraionDilach/OpenRA","description":"An open-source implementation of the Command & Conquer: Red Alert engine using .NET/Mono and OpenGL. Runs on Windows, Linux and Mac OS X.","fork":true,"url":"https://api.github.com/repos/GraionDilach/OpenRA","forks_url":"https://api.github.com/repos/GraionDilach/OpenRA/forks","keys_url":"https://api.github.com/repos/GraionDilach/OpenRA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GraionDilach/OpenRA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GraionDilach/OpenRA/teams","hooks_url":"https://api.github.com/repos/GraionDilach/OpenRA/hooks","issue_events_url":"https://api.github.com/repos/GraionDilach/OpenRA/issues/events{/number}","events_url":"https://api.github.com/repos/GraionDilach/OpenRA/events","assignees_url":"https://api.github.com/repos/GraionDilach/OpenRA/assignees{/user}","branches_url":"https://api.github.com/repos/GraionDilach/OpenRA/branches{/branch}","tags_url":"https://api.github.com/repos/GraionDilach/OpenRA/tags","blobs_url":"https://api.github.com/repos/GraionDilach/OpenRA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GraionDilach/OpenRA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GraionDilach/OpenRA/git/refs{/sha}","trees_url":"https://api.github.com/repos/GraionDilach/OpenRA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GraionDilach/OpenRA/statuses/{sha}","languages_url":"https://api.github.com/repos/GraionDilach/OpenRA/languages","stargazers_url":"https://api.github.com/repos/GraionDilach/OpenRA/stargazers","contributors_url":"https://api.github.com/repos/GraionDilach/OpenRA/contributors","subscribers_url":"https://api.github.com/repos/GraionDilach/OpenRA/subscribers","subscription_url":"https://api.github.com/repos/GraionDilach/OpenRA/subscription","commits_url":"https://api.github.com/repos/GraionDilach/OpenRA/commits{/sha}","git_commits_url":"https://api.github.com/repos/GraionDilach/OpenRA/git/commits{/sha}","comments_url":"https://api.github.com/repos/GraionDilach/OpenRA/comments{/number}","issue_comment_url":"https://api.github.com/repos/GraionDilach/OpenRA/issues/comments{/number}","contents_url":"https://api.github.com/repos/GraionDilach/OpenRA/contents/{+path}","compare_url":"https://api.github.com/repos/GraionDilach/OpenRA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GraionDilach/OpenRA/merges","archive_url":"https://api.github.com/repos/GraionDilach/OpenRA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GraionDilach/OpenRA/downloads","issues_url":"https://api.github.com/repos/GraionDilach/OpenRA/issues{/number}","pulls_url":"https://api.github.com/repos/GraionDilach/OpenRA/pulls{/number}","milestones_url":"https://api.github.com/repos/GraionDilach/OpenRA/milestones{/number}","notifications_url":"https://api.github.com/repos/GraionDilach/OpenRA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GraionDilach/OpenRA/labels{/name}","releases_url":"https://api.github.com/repos/GraionDilach/OpenRA/releases{/id}","created_at":"2015-03-04T17:55:26Z","updated_at":"2015-03-04T17:55:32Z","pushed_at":"2015-09-02T12:00:10Z","git_url":"git://github.com/GraionDilach/OpenRA.git","ssh_url":"git@github.com:GraionDilach/OpenRA.git","clone_url":"https://github.com/GraionDilach/OpenRA.git","svn_url":"https://github.com/GraionDilach/OpenRA","homepage":"http://www.openra.net","size":91513,"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":"bleed"}},"base":{"label":"OpenRA:bleed","ref":"bleed","sha":"509a0e54a26e7526d1136a14389246e487f77679","user":{"login":"OpenRA","id":409046,"avatar_url":"https://avatars.githubusercontent.com/u/409046?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenRA","html_url":"https://github.com/OpenRA","followers_url":"https://api.github.com/users/OpenRA/followers","following_url":"https://api.github.com/users/OpenRA/following{/other_user}","gists_url":"https://api.github.com/users/OpenRA/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenRA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenRA/subscriptions","organizations_url":"https://api.github.com/users/OpenRA/orgs","repos_url":"https://api.github.com/users/OpenRA/repos","events_url":"https://api.github.com/users/OpenRA/events{/privacy}","received_events_url":"https://api.github.com/users/OpenRA/received_events","type":"Organization","site_admin":false},"repo":{"id":959908,"name":"OpenRA","full_name":"OpenRA/OpenRA","owner":{"login":"OpenRA","id":409046,"avatar_url":"https://avatars.githubusercontent.com/u/409046?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenRA","html_url":"https://github.com/OpenRA","followers_url":"https://api.github.com/users/OpenRA/followers","following_url":"https://api.github.com/users/OpenRA/following{/other_user}","gists_url":"https://api.github.com/users/OpenRA/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenRA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenRA/subscriptions","organizations_url":"https://api.github.com/users/OpenRA/orgs","repos_url":"https://api.github.com/users/OpenRA/repos","events_url":"https://api.github.com/users/OpenRA/events{/privacy}","received_events_url":"https://api.github.com/users/OpenRA/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenRA/OpenRA","description":"Open Source real-time strategy game engine for early Westwood games such as Command & Conquer: Red Alert written in C# using SDL and OpenGL. Runs on Windows, Linux, *BSD and Mac OS X.","fork":false,"url":"https://api.github.com/repos/OpenRA/OpenRA","forks_url":"https://api.github.com/repos/OpenRA/OpenRA/forks","keys_url":"https://api.github.com/repos/OpenRA/OpenRA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenRA/OpenRA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenRA/OpenRA/teams","hooks_url":"https://api.github.com/repos/OpenRA/OpenRA/hooks","issue_events_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/events{/number}","events_url":"https://api.github.com/repos/OpenRA/OpenRA/events","assignees_url":"https://api.github.com/repos/OpenRA/OpenRA/assignees{/user}","branches_url":"https://api.github.com/repos/OpenRA/OpenRA/branches{/branch}","tags_url":"https://api.github.com/repos/OpenRA/OpenRA/tags","blobs_url":"https://api.github.com/repos/OpenRA/OpenRA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenRA/OpenRA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenRA/OpenRA/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenRA/OpenRA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenRA/OpenRA/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenRA/OpenRA/languages","stargazers_url":"https://api.github.com/repos/OpenRA/OpenRA/stargazers","contributors_url":"https://api.github.com/repos/OpenRA/OpenRA/contributors","subscribers_url":"https://api.github.com/repos/OpenRA/OpenRA/subscribers","subscription_url":"https://api.github.com/repos/OpenRA/OpenRA/subscription","commits_url":"https://api.github.com/repos/OpenRA/OpenRA/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenRA/OpenRA/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenRA/OpenRA/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenRA/OpenRA/contents/{+path}","compare_url":"https://api.github.com/repos/OpenRA/OpenRA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenRA/OpenRA/merges","archive_url":"https://api.github.com/repos/OpenRA/OpenRA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenRA/OpenRA/downloads","issues_url":"https://api.github.com/repos/OpenRA/OpenRA/issues{/number}","pulls_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenRA/OpenRA/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenRA/OpenRA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenRA/OpenRA/labels{/name}","releases_url":"https://api.github.com/repos/OpenRA/OpenRA/releases{/id}","created_at":"2010-10-04T07:38:05Z","updated_at":"2015-09-01T20:12:07Z","pushed_at":"2015-09-02T19:14:13Z","git_url":"git://github.com/OpenRA/OpenRA.git","ssh_url":"git@github.com:OpenRA/OpenRA.git","clone_url":"https://github.com/OpenRA/OpenRA.git","svn_url":"https://github.com/OpenRA/OpenRA","homepage":"http://www.openra.net","size":187014,"stargazers_count":2119,"watchers_count":2119,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":758,"mirror_url":null,"open_issues_count":865,"forks":758,"open_issues":865,"watchers":2119,"default_branch":"bleed"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/9222"},"html":{"href":"https://github.com/OpenRA/OpenRA/pull/9222"},"issue":{"href":"https://api.github.com/repos/OpenRA/OpenRA/issues/9222"},"comments":{"href":"https://api.github.com/repos/OpenRA/OpenRA/issues/9222/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/9222/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/9222/commits"},"statuses":{"href":"https://api.github.com/repos/OpenRA/OpenRA/statuses/11c5144cb490a5e14c9b43ce1404db5cfdd5bdd6"}}}}