{"action":"created","comment":{"url":"https://api.github.com/repos/wiremod/wire/pulls/comments/38819035","id":38819035,"diff_hunk":"@@ -0,0 +1,190 @@\n+E2Lib.RegisterExtension(\"collcallback\", true)\n+\n+local maxcollclk = CreateConVar( \"wire_col_detector_e2_maxcollclk\", 100, 0, \"Maximum amount of props with collision detection per gate\" )\n+local collallow = CreateConVar( \"wire_col_detector_e2_collallow\", 1, 0, \"Allow collision detection of other players' stuff\" )\n+\n+local registered_ents = {}\n+\n+registerCallback(\"construct\",function(self)\n+\tself.colDatas = {}\n+\tself.colEnts = {}\n+\tself.collFilter = true\n+\tself.collIgnoreConstrained = true\n+\tself.colProps=0\n+end)\n+\n+hook.Add(\"EntityRemoved\", \"Raf2EntityRemoved\",function (ent)\n+\tregistered_ents[ent]=nil\n+end)\n+\n+function entitiesCollide(ent,data)\n+\tfor i = 1,#registered_ents[ent],1 do\n+\t\tself = registered_ents[ent][i]\n+\t\tif not IsValid(self.entity) then\n+\t\t\ttable.remove(registered_ents[ent],i)\n+\t\t\ti = i-1\n+\t\telse\n+\t\t\tif (self.collFilter and #self.colDatas ~= 0) or (self.collIgnoreConstrained and table.HasValue(constraint.GetAllConstrainedEntities(ent),data.HitEntity)) then return end\n+\t\t\tself.colData=data\n+\t\t\tself.colData.ourEnt = ent\n+\t\t\tself.colData.posFirst = ent:GetPhysicsObject():GetPos()\n+\t\t\tself.colData.posSecond = data.HitEntity:GetPhysicsObject():GetPos()\n+\t\t\tself.colData.angleFirst = ent:GetPhysicsObject():GetAngles()\n+\t\t\tself.colData.angleSecond = data.HitEntity:GetPhysicsObject():GetAngles()\n+\t\t\tif self.physicsEarlyCallback then\n+\t\t\t\tself.entity:Execute()\n+\t\t\telse\n+\t\t\t\ttable.insert(self.colDatas,data)","path":"lua/entities/gmod_wire_expression2/core/custom/collcallback.lua","position":37,"original_position":37,"commit_id":"dafbecbdf612c5195f89f9718ecbee8001a2c7df","original_commit_id":"dafbecbdf612c5195f89f9718ecbee8001a2c7df","user":{"login":"TomyLobo","id":963797,"avatar_url":"https://avatars.githubusercontent.com/u/963797?v=3","gravatar_id":"","url":"https://api.github.com/users/TomyLobo","html_url":"https://github.com/TomyLobo","followers_url":"https://api.github.com/users/TomyLobo/followers","following_url":"https://api.github.com/users/TomyLobo/following{/other_user}","gists_url":"https://api.github.com/users/TomyLobo/gists{/gist_id}","starred_url":"https://api.github.com/users/TomyLobo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomyLobo/subscriptions","organizations_url":"https://api.github.com/users/TomyLobo/orgs","repos_url":"https://api.github.com/users/TomyLobo/repos","events_url":"https://api.github.com/users/TomyLobo/events{/privacy}","received_events_url":"https://api.github.com/users/TomyLobo/received_events","type":"User","site_admin":false},"body":"spaces after commas","created_at":"2015-09-06T08:34:07Z","updated_at":"2015-09-06T08:34:07Z","html_url":"https://github.com/wiremod/wire/pull/954#discussion_r38819035","pull_request_url":"https://api.github.com/repos/wiremod/wire/pulls/954","_links":{"self":{"href":"https://api.github.com/repos/wiremod/wire/pulls/comments/38819035"},"html":{"href":"https://github.com/wiremod/wire/pull/954#discussion_r38819035"},"pull_request":{"href":"https://api.github.com/repos/wiremod/wire/pulls/954"}}},"pull_request":{"url":"https://api.github.com/repos/wiremod/wire/pulls/954","id":43694215,"html_url":"https://github.com/wiremod/wire/pull/954","diff_url":"https://github.com/wiremod/wire/pull/954.diff","patch_url":"https://github.com/wiremod/wire/pull/954.patch","issue_url":"https://api.github.com/repos/wiremod/wire/issues/954","number":954,"state":"open","locked":false,"title":"Added collision detection","user":{"login":"rafradek","id":996690,"avatar_url":"https://avatars.githubusercontent.com/u/996690?v=3","gravatar_id":"","url":"https://api.github.com/users/rafradek","html_url":"https://github.com/rafradek","followers_url":"https://api.github.com/users/rafradek/followers","following_url":"https://api.github.com/users/rafradek/following{/other_user}","gists_url":"https://api.github.com/users/rafradek/gists{/gist_id}","starred_url":"https://api.github.com/users/rafradek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafradek/subscriptions","organizations_url":"https://api.github.com/users/rafradek/orgs","repos_url":"https://api.github.com/users/rafradek/repos","events_url":"https://api.github.com/users/rafradek/events{/privacy}","received_events_url":"https://api.github.com/users/rafradek/received_events","type":"User","site_admin":false},"body":"I previously made an addon for E2 called collision detection, but I think it is better to have this feature included in official wire, so I am creating this pull request. You can see more info about this addon here: http://steamcommunity.com/sharedfiles/filedetails/?id=368603077","created_at":"2015-08-29T12:58:25Z","updated_at":"2015-09-06T08:34:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dbc40153def7b31d730e52d95ea15862cff44a09","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wiremod/wire/pulls/954/commits","review_comments_url":"https://api.github.com/repos/wiremod/wire/pulls/954/comments","review_comment_url":"https://api.github.com/repos/wiremod/wire/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wiremod/wire/issues/954/comments","statuses_url":"https://api.github.com/repos/wiremod/wire/statuses/dafbecbdf612c5195f89f9718ecbee8001a2c7df","head":{"label":"rafradek:master","ref":"master","sha":"dafbecbdf612c5195f89f9718ecbee8001a2c7df","user":{"login":"rafradek","id":996690,"avatar_url":"https://avatars.githubusercontent.com/u/996690?v=3","gravatar_id":"","url":"https://api.github.com/users/rafradek","html_url":"https://github.com/rafradek","followers_url":"https://api.github.com/users/rafradek/followers","following_url":"https://api.github.com/users/rafradek/following{/other_user}","gists_url":"https://api.github.com/users/rafradek/gists{/gist_id}","starred_url":"https://api.github.com/users/rafradek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafradek/subscriptions","organizations_url":"https://api.github.com/users/rafradek/orgs","repos_url":"https://api.github.com/users/rafradek/repos","events_url":"https://api.github.com/users/rafradek/events{/privacy}","received_events_url":"https://api.github.com/users/rafradek/received_events","type":"User","site_admin":false},"repo":{"id":41592440,"name":"wire","full_name":"rafradek/wire","owner":{"login":"rafradek","id":996690,"avatar_url":"https://avatars.githubusercontent.com/u/996690?v=3","gravatar_id":"","url":"https://api.github.com/users/rafradek","html_url":"https://github.com/rafradek","followers_url":"https://api.github.com/users/rafradek/followers","following_url":"https://api.github.com/users/rafradek/following{/other_user}","gists_url":"https://api.github.com/users/rafradek/gists{/gist_id}","starred_url":"https://api.github.com/users/rafradek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafradek/subscriptions","organizations_url":"https://api.github.com/users/rafradek/orgs","repos_url":"https://api.github.com/users/rafradek/repos","events_url":"https://api.github.com/users/rafradek/events{/privacy}","received_events_url":"https://api.github.com/users/rafradek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rafradek/wire","description":"Garry's Mod add-on that allows users to wire up components in order to make more elaborate automatic and user-controlled contraptions.","fork":true,"url":"https://api.github.com/repos/rafradek/wire","forks_url":"https://api.github.com/repos/rafradek/wire/forks","keys_url":"https://api.github.com/repos/rafradek/wire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rafradek/wire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rafradek/wire/teams","hooks_url":"https://api.github.com/repos/rafradek/wire/hooks","issue_events_url":"https://api.github.com/repos/rafradek/wire/issues/events{/number}","events_url":"https://api.github.com/repos/rafradek/wire/events","assignees_url":"https://api.github.com/repos/rafradek/wire/assignees{/user}","branches_url":"https://api.github.com/repos/rafradek/wire/branches{/branch}","tags_url":"https://api.github.com/repos/rafradek/wire/tags","blobs_url":"https://api.github.com/repos/rafradek/wire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rafradek/wire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rafradek/wire/git/refs{/sha}","trees_url":"https://api.github.com/repos/rafradek/wire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rafradek/wire/statuses/{sha}","languages_url":"https://api.github.com/repos/rafradek/wire/languages","stargazers_url":"https://api.github.com/repos/rafradek/wire/stargazers","contributors_url":"https://api.github.com/repos/rafradek/wire/contributors","subscribers_url":"https://api.github.com/repos/rafradek/wire/subscribers","subscription_url":"https://api.github.com/repos/rafradek/wire/subscription","commits_url":"https://api.github.com/repos/rafradek/wire/commits{/sha}","git_commits_url":"https://api.github.com/repos/rafradek/wire/git/commits{/sha}","comments_url":"https://api.github.com/repos/rafradek/wire/comments{/number}","issue_comment_url":"https://api.github.com/repos/rafradek/wire/issues/comments{/number}","contents_url":"https://api.github.com/repos/rafradek/wire/contents/{+path}","compare_url":"https://api.github.com/repos/rafradek/wire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rafradek/wire/merges","archive_url":"https://api.github.com/repos/rafradek/wire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rafradek/wire/downloads","issues_url":"https://api.github.com/repos/rafradek/wire/issues{/number}","pulls_url":"https://api.github.com/repos/rafradek/wire/pulls{/number}","milestones_url":"https://api.github.com/repos/rafradek/wire/milestones{/number}","notifications_url":"https://api.github.com/repos/rafradek/wire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rafradek/wire/labels{/name}","releases_url":"https://api.github.com/repos/rafradek/wire/releases{/id}","created_at":"2015-08-29T12:16:36Z","updated_at":"2015-08-29T12:16:38Z","pushed_at":"2015-09-04T18:56:21Z","git_url":"git://github.com/rafradek/wire.git","ssh_url":"git@github.com:rafradek/wire.git","clone_url":"https://github.com/rafradek/wire.git","svn_url":"https://github.com/rafradek/wire","homepage":"http://www.wiremod.com","size":17791,"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":"master"}},"base":{"label":"wiremod:master","ref":"master","sha":"6c750ef6a7d174d2442087fc7444cc5a30581545","user":{"login":"wiremod","id":113164,"avatar_url":"https://avatars.githubusercontent.com/u/113164?v=3","gravatar_id":"","url":"https://api.github.com/users/wiremod","html_url":"https://github.com/wiremod","followers_url":"https://api.github.com/users/wiremod/followers","following_url":"https://api.github.com/users/wiremod/following{/other_user}","gists_url":"https://api.github.com/users/wiremod/gists{/gist_id}","starred_url":"https://api.github.com/users/wiremod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wiremod/subscriptions","organizations_url":"https://api.github.com/users/wiremod/orgs","repos_url":"https://api.github.com/users/wiremod/repos","events_url":"https://api.github.com/users/wiremod/events{/privacy}","received_events_url":"https://api.github.com/users/wiremod/received_events","type":"Organization","site_admin":false},"repo":{"id":4248640,"name":"wire","full_name":"wiremod/wire","owner":{"login":"wiremod","id":113164,"avatar_url":"https://avatars.githubusercontent.com/u/113164?v=3","gravatar_id":"","url":"https://api.github.com/users/wiremod","html_url":"https://github.com/wiremod","followers_url":"https://api.github.com/users/wiremod/followers","following_url":"https://api.github.com/users/wiremod/following{/other_user}","gists_url":"https://api.github.com/users/wiremod/gists{/gist_id}","starred_url":"https://api.github.com/users/wiremod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wiremod/subscriptions","organizations_url":"https://api.github.com/users/wiremod/orgs","repos_url":"https://api.github.com/users/wiremod/repos","events_url":"https://api.github.com/users/wiremod/events{/privacy}","received_events_url":"https://api.github.com/users/wiremod/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wiremod/wire","description":"Garry's Mod add-on that allows users to wire up components in order to make more elaborate automatic and user-controlled contraptions.","fork":false,"url":"https://api.github.com/repos/wiremod/wire","forks_url":"https://api.github.com/repos/wiremod/wire/forks","keys_url":"https://api.github.com/repos/wiremod/wire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wiremod/wire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wiremod/wire/teams","hooks_url":"https://api.github.com/repos/wiremod/wire/hooks","issue_events_url":"https://api.github.com/repos/wiremod/wire/issues/events{/number}","events_url":"https://api.github.com/repos/wiremod/wire/events","assignees_url":"https://api.github.com/repos/wiremod/wire/assignees{/user}","branches_url":"https://api.github.com/repos/wiremod/wire/branches{/branch}","tags_url":"https://api.github.com/repos/wiremod/wire/tags","blobs_url":"https://api.github.com/repos/wiremod/wire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wiremod/wire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wiremod/wire/git/refs{/sha}","trees_url":"https://api.github.com/repos/wiremod/wire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wiremod/wire/statuses/{sha}","languages_url":"https://api.github.com/repos/wiremod/wire/languages","stargazers_url":"https://api.github.com/repos/wiremod/wire/stargazers","contributors_url":"https://api.github.com/repos/wiremod/wire/contributors","subscribers_url":"https://api.github.com/repos/wiremod/wire/subscribers","subscription_url":"https://api.github.com/repos/wiremod/wire/subscription","commits_url":"https://api.github.com/repos/wiremod/wire/commits{/sha}","git_commits_url":"https://api.github.com/repos/wiremod/wire/git/commits{/sha}","comments_url":"https://api.github.com/repos/wiremod/wire/comments{/number}","issue_comment_url":"https://api.github.com/repos/wiremod/wire/issues/comments{/number}","contents_url":"https://api.github.com/repos/wiremod/wire/contents/{+path}","compare_url":"https://api.github.com/repos/wiremod/wire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wiremod/wire/merges","archive_url":"https://api.github.com/repos/wiremod/wire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wiremod/wire/downloads","issues_url":"https://api.github.com/repos/wiremod/wire/issues{/number}","pulls_url":"https://api.github.com/repos/wiremod/wire/pulls{/number}","milestones_url":"https://api.github.com/repos/wiremod/wire/milestones{/number}","notifications_url":"https://api.github.com/repos/wiremod/wire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wiremod/wire/labels{/name}","releases_url":"https://api.github.com/repos/wiremod/wire/releases{/id}","created_at":"2012-05-07T10:55:50Z","updated_at":"2015-08-27T05:00:45Z","pushed_at":"2015-09-05T17:42:57Z","git_url":"git://github.com/wiremod/wire.git","ssh_url":"git@github.com:wiremod/wire.git","clone_url":"https://github.com/wiremod/wire.git","svn_url":"https://github.com/wiremod/wire","homepage":"http://www.wiremod.com","size":27929,"stargazers_count":210,"watchers_count":210,"language":"Lua","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":228,"mirror_url":null,"open_issues_count":76,"forks":228,"open_issues":76,"watchers":210,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wiremod/wire/pulls/954"},"html":{"href":"https://github.com/wiremod/wire/pull/954"},"issue":{"href":"https://api.github.com/repos/wiremod/wire/issues/954"},"comments":{"href":"https://api.github.com/repos/wiremod/wire/issues/954/comments"},"review_comments":{"href":"https://api.github.com/repos/wiremod/wire/pulls/954/comments"},"review_comment":{"href":"https://api.github.com/repos/wiremod/wire/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wiremod/wire/pulls/954/commits"},"statuses":{"href":"https://api.github.com/repos/wiremod/wire/statuses/dafbecbdf612c5195f89f9718ecbee8001a2c7df"}}}}