{"action":"created","comment":{"url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/pulls/comments/65109919","id":65109919,"diff_hunk":"@@ -730,27 +733,36 @@ var tick = function() {\n \t\t\t\tif(!(\"units\" in node)) {\n \t\t\t\t\tnode.units = {};\n \t\t\t\t}\n-\t\t\t\tif(nodeWinner == node.owner || node.owner == -1 || nodeWinner === -1) {\n-\t\t\t\t\tif(node.owner != -1) {\n-\t\t\t\t\t\tnodeWinner = node.owner;\n+\t\t\t\tif (node.owner == -3) {\n+\t\t\t\t\tfor (var owner in node.units) {\n+\t\t\t\t\t\t// convert all units to energy\n+\t\t\t\t\t\tgd.data.energy[owner] = Math.min(gd.data.energy[owner] + node.units[owner], GAMERULES.MAX_ENERGY);\n+\t\t\t\t\t\tnode.units[owner] = 0;\n+\t\t\t\t\t\tlogins[gd.users[adjustForRemoved(gd, owner)]].conn.send(\"energy:\" + gd.data.energy[owner]);\n \t\t\t\t\t}\n-\t\t\t\t}\n-\t\t\t\telse {\n-\t\t\t\t\tif(gd.debug) {\n-\t\t\t\t\t\tconsole.log(\"contested due to node owner\");\n-\t\t\t\t\t\tconsole.log(nodeWinner, node.owner, typeof nodeWinner, typeof node.owner);\n+\t\t\t\t} else {\n+\t\t\t\t\tif(nodeWinner == node.owner || node.owner == -1 || nodeWinner === -1) {\n+\t\t\t\t\t\tif(node.owner != -1) {\n+\t\t\t\t\t\t\tnodeWinner = node.owner;\n+\t\t\t\t\t\t}\n \t\t\t\t\t}\n-\t\t\t\t\tunitsUncontested = false;\n-\t\t\t\t}\n-\t\t\t\tfor(var owner in node.units) {\n-\t\t\t\t\tif(owner != node.owner && node.units[owner] > 0) {\n+\t\t\t\t\telse {\n \t\t\t\t\t\tif(gd.debug) {\n-\t\t\t\t\t\t\tconsole.log(\"contested due to units\");\n+\t\t\t\t\t\t\tconsole.log(\"contested due to node owner\");\n+\t\t\t\t\t\t\tconsole.log(nodeWinner, node.owner, typeof nodeWinner, typeof node.owner);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tunitsUncontested = false;\n \t\t\t\t\t}\n+\t\t\t\t\tfor(var unitOwner in node.units) {\n+\t\t\t\t\t\tif(unitOwner != node.owner && node.units[unitOwner] > 0) {","path":"index.js","position":74,"original_position":74,"commit_id":"dd5cf44f0392730139530d5b08ba1a7dae9eb860","original_commit_id":"dd5cf44f0392730139530d5b08ba1a7dae9eb860","user":{"login":"vpzomtrrfrt","id":3528358,"avatar_url":"https://avatars.githubusercontent.com/u/3528358?v=3","gravatar_id":"","url":"https://api.github.com/users/vpzomtrrfrt","html_url":"https://github.com/vpzomtrrfrt","followers_url":"https://api.github.com/users/vpzomtrrfrt/followers","following_url":"https://api.github.com/users/vpzomtrrfrt/following{/other_user}","gists_url":"https://api.github.com/users/vpzomtrrfrt/gists{/gist_id}","starred_url":"https://api.github.com/users/vpzomtrrfrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpzomtrrfrt/subscriptions","organizations_url":"https://api.github.com/users/vpzomtrrfrt/orgs","repos_url":"https://api.github.com/users/vpzomtrrfrt/repos","events_url":"https://api.github.com/users/vpzomtrrfrt/events{/privacy}","received_events_url":"https://api.github.com/users/vpzomtrrfrt/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Expected '!==' and instead saw '!='.](https://www.codacy.com/app/vpzomtrrfrt/turbo-spork-server/file/2657327436/issues/source?bid=3248399&fileBranchId=3307983#l757)","created_at":"2016-05-30T23:10:28Z","updated_at":"2016-05-30T23:10:28Z","html_url":"https://github.com/fictional-pancake/turbo-spork-server/pull/6#discussion_r65109919","pull_request_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/pulls/comments/65109919"},"html":{"href":"https://github.com/fictional-pancake/turbo-spork-server/pull/6#discussion_r65109919"},"pull_request":{"href":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/pulls/6","id":70733640,"html_url":"https://github.com/fictional-pancake/turbo-spork-server/pull/6","diff_url":"https://github.com/fictional-pancake/turbo-spork-server/pull/6.diff","patch_url":"https://github.com/fictional-pancake/turbo-spork-server/pull/6.patch","issue_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/issues/6","number":6,"state":"open","locked":false,"title":"Spellz and energy","user":{"login":"fortninja","id":14242898,"avatar_url":"https://avatars.githubusercontent.com/u/14242898?v=3","gravatar_id":"","url":"https://api.github.com/users/fortninja","html_url":"https://github.com/fortninja","followers_url":"https://api.github.com/users/fortninja/followers","following_url":"https://api.github.com/users/fortninja/following{/other_user}","gists_url":"https://api.github.com/users/fortninja/gists{/gist_id}","starred_url":"https://api.github.com/users/fortninja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fortninja/subscriptions","organizations_url":"https://api.github.com/users/fortninja/orgs","repos_url":"https://api.github.com/users/fortninja/repos","events_url":"https://api.github.com/users/fortninja/events{/privacy}","received_events_url":"https://api.github.com/users/fortninja/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-19T17:28:36Z","updated_at":"2016-05-30T23:10:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3e78489f2ac5ddd858863cc54d82eff312e3d87","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/pulls/6/commits","review_comments_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/pulls/6/comments","review_comment_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/issues/6/comments","statuses_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/statuses/dd5cf44f0392730139530d5b08ba1a7dae9eb860","head":{"label":"fictional-pancake:spells","ref":"spells","sha":"dd5cf44f0392730139530d5b08ba1a7dae9eb860","user":{"login":"fictional-pancake","id":16624810,"avatar_url":"https://avatars.githubusercontent.com/u/16624810?v=3","gravatar_id":"","url":"https://api.github.com/users/fictional-pancake","html_url":"https://github.com/fictional-pancake","followers_url":"https://api.github.com/users/fictional-pancake/followers","following_url":"https://api.github.com/users/fictional-pancake/following{/other_user}","gists_url":"https://api.github.com/users/fictional-pancake/gists{/gist_id}","starred_url":"https://api.github.com/users/fictional-pancake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fictional-pancake/subscriptions","organizations_url":"https://api.github.com/users/fictional-pancake/orgs","repos_url":"https://api.github.com/users/fictional-pancake/repos","events_url":"https://api.github.com/users/fictional-pancake/events{/privacy}","received_events_url":"https://api.github.com/users/fictional-pancake/received_events","type":"Organization","site_admin":false},"repo":{"id":50757214,"name":"turbo-spork-server","full_name":"fictional-pancake/turbo-spork-server","owner":{"login":"fictional-pancake","id":16624810,"avatar_url":"https://avatars.githubusercontent.com/u/16624810?v=3","gravatar_id":"","url":"https://api.github.com/users/fictional-pancake","html_url":"https://github.com/fictional-pancake","followers_url":"https://api.github.com/users/fictional-pancake/followers","following_url":"https://api.github.com/users/fictional-pancake/following{/other_user}","gists_url":"https://api.github.com/users/fictional-pancake/gists{/gist_id}","starred_url":"https://api.github.com/users/fictional-pancake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fictional-pancake/subscriptions","organizations_url":"https://api.github.com/users/fictional-pancake/orgs","repos_url":"https://api.github.com/users/fictional-pancake/repos","events_url":"https://api.github.com/users/fictional-pancake/events{/privacy}","received_events_url":"https://api.github.com/users/fictional-pancake/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fictional-pancake/turbo-spork-server","description":"Server for Turbo-Spork","fork":false,"url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server","forks_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/forks","keys_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/teams","hooks_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/hooks","issue_events_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/issues/events{/number}","events_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/events","assignees_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/assignees{/user}","branches_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/branches{/branch}","tags_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/tags","blobs_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/statuses/{sha}","languages_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/languages","stargazers_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/stargazers","contributors_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/contributors","subscribers_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/subscribers","subscription_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/subscription","commits_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/contents/{+path}","compare_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/merges","archive_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/downloads","issues_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/issues{/number}","pulls_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/pulls{/number}","milestones_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/milestones{/number}","notifications_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/labels{/name}","releases_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/releases{/id}","deployments_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/deployments","created_at":"2016-01-31T03:34:38Z","updated_at":"2016-03-30T23:54:00Z","pushed_at":"2016-05-30T23:08:27Z","git_url":"git://github.com/fictional-pancake/turbo-spork-server.git","ssh_url":"git@github.com:fictional-pancake/turbo-spork-server.git","clone_url":"https://github.com/fictional-pancake/turbo-spork-server.git","svn_url":"https://github.com/fictional-pancake/turbo-spork-server","homepage":null,"size":83,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":2,"default_branch":"master"}},"base":{"label":"fictional-pancake:master","ref":"master","sha":"06326745314dad8930fd0e79c7dd37e3d004ae3a","user":{"login":"fictional-pancake","id":16624810,"avatar_url":"https://avatars.githubusercontent.com/u/16624810?v=3","gravatar_id":"","url":"https://api.github.com/users/fictional-pancake","html_url":"https://github.com/fictional-pancake","followers_url":"https://api.github.com/users/fictional-pancake/followers","following_url":"https://api.github.com/users/fictional-pancake/following{/other_user}","gists_url":"https://api.github.com/users/fictional-pancake/gists{/gist_id}","starred_url":"https://api.github.com/users/fictional-pancake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fictional-pancake/subscriptions","organizations_url":"https://api.github.com/users/fictional-pancake/orgs","repos_url":"https://api.github.com/users/fictional-pancake/repos","events_url":"https://api.github.com/users/fictional-pancake/events{/privacy}","received_events_url":"https://api.github.com/users/fictional-pancake/received_events","type":"Organization","site_admin":false},"repo":{"id":50757214,"name":"turbo-spork-server","full_name":"fictional-pancake/turbo-spork-server","owner":{"login":"fictional-pancake","id":16624810,"avatar_url":"https://avatars.githubusercontent.com/u/16624810?v=3","gravatar_id":"","url":"https://api.github.com/users/fictional-pancake","html_url":"https://github.com/fictional-pancake","followers_url":"https://api.github.com/users/fictional-pancake/followers","following_url":"https://api.github.com/users/fictional-pancake/following{/other_user}","gists_url":"https://api.github.com/users/fictional-pancake/gists{/gist_id}","starred_url":"https://api.github.com/users/fictional-pancake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fictional-pancake/subscriptions","organizations_url":"https://api.github.com/users/fictional-pancake/orgs","repos_url":"https://api.github.com/users/fictional-pancake/repos","events_url":"https://api.github.com/users/fictional-pancake/events{/privacy}","received_events_url":"https://api.github.com/users/fictional-pancake/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fictional-pancake/turbo-spork-server","description":"Server for Turbo-Spork","fork":false,"url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server","forks_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/forks","keys_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/teams","hooks_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/hooks","issue_events_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/issues/events{/number}","events_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/events","assignees_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/assignees{/user}","branches_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/branches{/branch}","tags_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/tags","blobs_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/statuses/{sha}","languages_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/languages","stargazers_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/stargazers","contributors_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/contributors","subscribers_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/subscribers","subscription_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/subscription","commits_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/contents/{+path}","compare_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/merges","archive_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/downloads","issues_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/issues{/number}","pulls_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/pulls{/number}","milestones_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/milestones{/number}","notifications_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/labels{/name}","releases_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/releases{/id}","deployments_url":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/deployments","created_at":"2016-01-31T03:34:38Z","updated_at":"2016-03-30T23:54:00Z","pushed_at":"2016-05-30T23:08:27Z","git_url":"git://github.com/fictional-pancake/turbo-spork-server.git","ssh_url":"git@github.com:fictional-pancake/turbo-spork-server.git","clone_url":"https://github.com/fictional-pancake/turbo-spork-server.git","svn_url":"https://github.com/fictional-pancake/turbo-spork-server","homepage":null,"size":83,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/pulls/6"},"html":{"href":"https://github.com/fictional-pancake/turbo-spork-server/pull/6"},"issue":{"href":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/issues/6"},"comments":{"href":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/fictional-pancake/turbo-spork-server/statuses/dd5cf44f0392730139530d5b08ba1a7dae9eb860"}}}}
{"actor":{"display_login":"vpzomtrrfrt"}}