{"action":"created","comment":{"url":"https://api.github.com/repos/DougTy/gibmod/pulls/comments/34533554","id":34533554,"diff_hunk":"@@ -923,28 +878,24 @@ hook.Add( \"DoPlayerDeath\", \"Gib_PlayerDeath\", GibMod_DoPlayerDeath )\n \n function GibMod_ScaleNPCDamage( ent, hitgroup, dmginfo )\t\n \t-- necessary to override vanilla ragdolls and weapon drop\n-\t\n-\tif gibmodEnabled:GetBool() then\t\n-\t\tlocal damageAmt = dmginfo:GetDamage()\n-\t\t\n-\t\t-- check if the entity or model is nongibbable\n-\t\tif not TableContains( nonGibbableEnts, ent:GetClass() ) then\n-\t\t\tif (ent:Health() - damageAmt) <= 0 then\t\t\t\t\n-\t\t\t\t-- do things manually\n-\t\t\t\tGibMod_EntityTakeDamage( ent, dmginfo, true )\n-\t\t\t\t\n-\t\t\t\t-- don't you dare do your own thing!\n-\t\t\t\treturn true\n-\t\t\tend\t\t\t\n-\t\tend\n+\tif not gibmodEnabled:GetBool() then return end\n+\t-- check if the entity or model is nongibbable\n+\tif not TableContains( nonGibbableEnts, ent:GetClass() ) then\n+\t\tent.GibMod_Damage = dmginfo\n+\t\t-- don't you dare do your own thing!\n+\t\treturn true\n \tend\n end\n-hook.Add( \"ScaleNPCDamage\", \"Gib_ScaleNpcDmg\", GibMod_ScaleNPCDamage )\n \n-function GibMod_PlayerSpawn( ply )\n-\tply.GibMod_Killed = false\n+function GibMod_KilledNPC( npc )\n+\tif not gibmodEnabled:GetBool() then return end\n+\tif npc.GibMod_Damage then\n+\t\tGibMod_HandleDeath( npc, npc.GibMod_Damage )\n+\tend\n end\n-hook.Add( \"PlayerSpawn\", \"GibMod_PlayerSpawn\", GibMod_PlayerSpawn )\n+\n+hook.Add( \"ScaleNPCDamage\", \"Gib_ScaleNpcDmg\", GibMod_ScaleNPCDamage )\n+hook.Add( \"OnNPCKilled\", \"Gib_KilledNPC\", GibMod_KilledNPC )","path":"lua/autorun/gibmod2.lua","position":464,"original_position":464,"commit_id":"ba96e3a2b3690d80b470dfc7784bcf1c106e188f","original_commit_id":"ba96e3a2b3690d80b470dfc7784bcf1c106e188f","user":{"login":"DougTy","id":4277176,"avatar_url":"https://avatars.githubusercontent.com/u/4277176?v=3","gravatar_id":"","url":"https://api.github.com/users/DougTy","html_url":"https://github.com/DougTy","followers_url":"https://api.github.com/users/DougTy/followers","following_url":"https://api.github.com/users/DougTy/following{/other_user}","gists_url":"https://api.github.com/users/DougTy/gists{/gist_id}","starred_url":"https://api.github.com/users/DougTy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DougTy/subscriptions","organizations_url":"https://api.github.com/users/DougTy/orgs","repos_url":"https://api.github.com/users/DougTy/repos","events_url":"https://api.github.com/users/DougTy/events{/privacy}","received_events_url":"https://api.github.com/users/DougTy/received_events","type":"User","site_admin":false},"body":"Didn't know about this hook, much better approach than what I was doing","created_at":"2015-07-14T02:51:26Z","updated_at":"2015-07-14T02:51:26Z","html_url":"https://github.com/DougTy/gibmod/pull/1#discussion_r34533554","pull_request_url":"https://api.github.com/repos/DougTy/gibmod/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/DougTy/gibmod/pulls/comments/34533554"},"html":{"href":"https://github.com/DougTy/gibmod/pull/1#discussion_r34533554"},"pull_request":{"href":"https://api.github.com/repos/DougTy/gibmod/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/DougTy/gibmod/pulls/1","id":39781167,"html_url":"https://github.com/DougTy/gibmod/pull/1","diff_url":"https://github.com/DougTy/gibmod/pull/1.diff","patch_url":"https://github.com/DougTy/gibmod/pull/1.patch","issue_url":"https://api.github.com/repos/DougTy/gibmod/issues/1","number":1,"state":"open","locked":false,"title":"Some improvements.","user":{"login":"thegrb93","id":6713261,"avatar_url":"https://avatars.githubusercontent.com/u/6713261?v=3","gravatar_id":"","url":"https://api.github.com/users/thegrb93","html_url":"https://github.com/thegrb93","followers_url":"https://api.github.com/users/thegrb93/followers","following_url":"https://api.github.com/users/thegrb93/following{/other_user}","gists_url":"https://api.github.com/users/thegrb93/gists{/gist_id}","starred_url":"https://api.github.com/users/thegrb93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thegrb93/subscriptions","organizations_url":"https://api.github.com/users/thegrb93/orgs","repos_url":"https://api.github.com/users/thegrb93/repos","events_url":"https://api.github.com/users/thegrb93/events{/privacy}","received_events_url":"https://api.github.com/users/thegrb93/received_events","type":"User","site_admin":false},"body":"Isn't tested very thoroughly but works for my purposes. Let me know if anything needs to be revised.","created_at":"2015-07-13T05:59:08Z","updated_at":"2015-07-14T02:51:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9394990e377b0d3ea40d7af98db78333229e1b5a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DougTy/gibmod/pulls/1/commits","review_comments_url":"https://api.github.com/repos/DougTy/gibmod/pulls/1/comments","review_comment_url":"https://api.github.com/repos/DougTy/gibmod/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DougTy/gibmod/issues/1/comments","statuses_url":"https://api.github.com/repos/DougTy/gibmod/statuses/ba96e3a2b3690d80b470dfc7784bcf1c106e188f","head":{"label":"thegrb93:master","ref":"master","sha":"ba96e3a2b3690d80b470dfc7784bcf1c106e188f","user":{"login":"thegrb93","id":6713261,"avatar_url":"https://avatars.githubusercontent.com/u/6713261?v=3","gravatar_id":"","url":"https://api.github.com/users/thegrb93","html_url":"https://github.com/thegrb93","followers_url":"https://api.github.com/users/thegrb93/followers","following_url":"https://api.github.com/users/thegrb93/following{/other_user}","gists_url":"https://api.github.com/users/thegrb93/gists{/gist_id}","starred_url":"https://api.github.com/users/thegrb93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thegrb93/subscriptions","organizations_url":"https://api.github.com/users/thegrb93/orgs","repos_url":"https://api.github.com/users/thegrb93/repos","events_url":"https://api.github.com/users/thegrb93/events{/privacy}","received_events_url":"https://api.github.com/users/thegrb93/received_events","type":"User","site_admin":false},"repo":{"id":38991208,"name":"gibmod","full_name":"thegrb93/gibmod","owner":{"login":"thegrb93","id":6713261,"avatar_url":"https://avatars.githubusercontent.com/u/6713261?v=3","gravatar_id":"","url":"https://api.github.com/users/thegrb93","html_url":"https://github.com/thegrb93","followers_url":"https://api.github.com/users/thegrb93/followers","following_url":"https://api.github.com/users/thegrb93/following{/other_user}","gists_url":"https://api.github.com/users/thegrb93/gists{/gist_id}","starred_url":"https://api.github.com/users/thegrb93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thegrb93/subscriptions","organizations_url":"https://api.github.com/users/thegrb93/orgs","repos_url":"https://api.github.com/users/thegrb93/repos","events_url":"https://api.github.com/users/thegrb93/events{/privacy}","received_events_url":"https://api.github.com/users/thegrb93/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thegrb93/gibmod","description":"silly gmod viscera addon","fork":true,"url":"https://api.github.com/repos/thegrb93/gibmod","forks_url":"https://api.github.com/repos/thegrb93/gibmod/forks","keys_url":"https://api.github.com/repos/thegrb93/gibmod/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thegrb93/gibmod/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thegrb93/gibmod/teams","hooks_url":"https://api.github.com/repos/thegrb93/gibmod/hooks","issue_events_url":"https://api.github.com/repos/thegrb93/gibmod/issues/events{/number}","events_url":"https://api.github.com/repos/thegrb93/gibmod/events","assignees_url":"https://api.github.com/repos/thegrb93/gibmod/assignees{/user}","branches_url":"https://api.github.com/repos/thegrb93/gibmod/branches{/branch}","tags_url":"https://api.github.com/repos/thegrb93/gibmod/tags","blobs_url":"https://api.github.com/repos/thegrb93/gibmod/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thegrb93/gibmod/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thegrb93/gibmod/git/refs{/sha}","trees_url":"https://api.github.com/repos/thegrb93/gibmod/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thegrb93/gibmod/statuses/{sha}","languages_url":"https://api.github.com/repos/thegrb93/gibmod/languages","stargazers_url":"https://api.github.com/repos/thegrb93/gibmod/stargazers","contributors_url":"https://api.github.com/repos/thegrb93/gibmod/contributors","subscribers_url":"https://api.github.com/repos/thegrb93/gibmod/subscribers","subscription_url":"https://api.github.com/repos/thegrb93/gibmod/subscription","commits_url":"https://api.github.com/repos/thegrb93/gibmod/commits{/sha}","git_commits_url":"https://api.github.com/repos/thegrb93/gibmod/git/commits{/sha}","comments_url":"https://api.github.com/repos/thegrb93/gibmod/comments{/number}","issue_comment_url":"https://api.github.com/repos/thegrb93/gibmod/issues/comments{/number}","contents_url":"https://api.github.com/repos/thegrb93/gibmod/contents/{+path}","compare_url":"https://api.github.com/repos/thegrb93/gibmod/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thegrb93/gibmod/merges","archive_url":"https://api.github.com/repos/thegrb93/gibmod/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thegrb93/gibmod/downloads","issues_url":"https://api.github.com/repos/thegrb93/gibmod/issues{/number}","pulls_url":"https://api.github.com/repos/thegrb93/gibmod/pulls{/number}","milestones_url":"https://api.github.com/repos/thegrb93/gibmod/milestones{/number}","notifications_url":"https://api.github.com/repos/thegrb93/gibmod/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thegrb93/gibmod/labels{/name}","releases_url":"https://api.github.com/repos/thegrb93/gibmod/releases{/id}","created_at":"2015-07-13T04:28:24Z","updated_at":"2015-07-13T04:28:24Z","pushed_at":"2015-07-13T07:16:16Z","git_url":"git://github.com/thegrb93/gibmod.git","ssh_url":"git@github.com:thegrb93/gibmod.git","clone_url":"https://github.com/thegrb93/gibmod.git","svn_url":"https://github.com/thegrb93/gibmod","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Lua","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"DougTy:master","ref":"master","sha":"2528c61bb98c3b046794e77ff606212aad8f3003","user":{"login":"DougTy","id":4277176,"avatar_url":"https://avatars.githubusercontent.com/u/4277176?v=3","gravatar_id":"","url":"https://api.github.com/users/DougTy","html_url":"https://github.com/DougTy","followers_url":"https://api.github.com/users/DougTy/followers","following_url":"https://api.github.com/users/DougTy/following{/other_user}","gists_url":"https://api.github.com/users/DougTy/gists{/gist_id}","starred_url":"https://api.github.com/users/DougTy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DougTy/subscriptions","organizations_url":"https://api.github.com/users/DougTy/orgs","repos_url":"https://api.github.com/users/DougTy/repos","events_url":"https://api.github.com/users/DougTy/events{/privacy}","received_events_url":"https://api.github.com/users/DougTy/received_events","type":"User","site_admin":false},"repo":{"id":38955502,"name":"gibmod","full_name":"DougTy/gibmod","owner":{"login":"DougTy","id":4277176,"avatar_url":"https://avatars.githubusercontent.com/u/4277176?v=3","gravatar_id":"","url":"https://api.github.com/users/DougTy","html_url":"https://github.com/DougTy","followers_url":"https://api.github.com/users/DougTy/followers","following_url":"https://api.github.com/users/DougTy/following{/other_user}","gists_url":"https://api.github.com/users/DougTy/gists{/gist_id}","starred_url":"https://api.github.com/users/DougTy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DougTy/subscriptions","organizations_url":"https://api.github.com/users/DougTy/orgs","repos_url":"https://api.github.com/users/DougTy/repos","events_url":"https://api.github.com/users/DougTy/events{/privacy}","received_events_url":"https://api.github.com/users/DougTy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DougTy/gibmod","description":"silly gmod viscera addon","fork":false,"url":"https://api.github.com/repos/DougTy/gibmod","forks_url":"https://api.github.com/repos/DougTy/gibmod/forks","keys_url":"https://api.github.com/repos/DougTy/gibmod/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DougTy/gibmod/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DougTy/gibmod/teams","hooks_url":"https://api.github.com/repos/DougTy/gibmod/hooks","issue_events_url":"https://api.github.com/repos/DougTy/gibmod/issues/events{/number}","events_url":"https://api.github.com/repos/DougTy/gibmod/events","assignees_url":"https://api.github.com/repos/DougTy/gibmod/assignees{/user}","branches_url":"https://api.github.com/repos/DougTy/gibmod/branches{/branch}","tags_url":"https://api.github.com/repos/DougTy/gibmod/tags","blobs_url":"https://api.github.com/repos/DougTy/gibmod/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DougTy/gibmod/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DougTy/gibmod/git/refs{/sha}","trees_url":"https://api.github.com/repos/DougTy/gibmod/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DougTy/gibmod/statuses/{sha}","languages_url":"https://api.github.com/repos/DougTy/gibmod/languages","stargazers_url":"https://api.github.com/repos/DougTy/gibmod/stargazers","contributors_url":"https://api.github.com/repos/DougTy/gibmod/contributors","subscribers_url":"https://api.github.com/repos/DougTy/gibmod/subscribers","subscription_url":"https://api.github.com/repos/DougTy/gibmod/subscription","commits_url":"https://api.github.com/repos/DougTy/gibmod/commits{/sha}","git_commits_url":"https://api.github.com/repos/DougTy/gibmod/git/commits{/sha}","comments_url":"https://api.github.com/repos/DougTy/gibmod/comments{/number}","issue_comment_url":"https://api.github.com/repos/DougTy/gibmod/issues/comments{/number}","contents_url":"https://api.github.com/repos/DougTy/gibmod/contents/{+path}","compare_url":"https://api.github.com/repos/DougTy/gibmod/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DougTy/gibmod/merges","archive_url":"https://api.github.com/repos/DougTy/gibmod/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DougTy/gibmod/downloads","issues_url":"https://api.github.com/repos/DougTy/gibmod/issues{/number}","pulls_url":"https://api.github.com/repos/DougTy/gibmod/pulls{/number}","milestones_url":"https://api.github.com/repos/DougTy/gibmod/milestones{/number}","notifications_url":"https://api.github.com/repos/DougTy/gibmod/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DougTy/gibmod/labels{/name}","releases_url":"https://api.github.com/repos/DougTy/gibmod/releases{/id}","created_at":"2015-07-12T08:44:25Z","updated_at":"2015-07-12T08:58:51Z","pushed_at":"2015-07-13T08:46:14Z","git_url":"git://github.com/DougTy/gibmod.git","ssh_url":"git@github.com:DougTy/gibmod.git","clone_url":"https://github.com/DougTy/gibmod.git","svn_url":"https://github.com/DougTy/gibmod","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Lua","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DougTy/gibmod/pulls/1"},"html":{"href":"https://github.com/DougTy/gibmod/pull/1"},"issue":{"href":"https://api.github.com/repos/DougTy/gibmod/issues/1"},"comments":{"href":"https://api.github.com/repos/DougTy/gibmod/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/DougTy/gibmod/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/DougTy/gibmod/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DougTy/gibmod/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/DougTy/gibmod/statuses/ba96e3a2b3690d80b470dfc7784bcf1c106e188f"}}}}