{"action":"created","comment":{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments/31157384","id":31157384,"diff_hunk":"@@ -1370,7 +1370,10 @@ bool Creature::CanStartAttack(Unit const* who, bool force) const\n     if (IsCivilian())\n         return false;\n \n-    if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC))\n+    if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC) && who->GetTypeId() != TYPEID_PLAYER)  // flag is valid only for non player characters\n+        return false;\n+\n+    if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC) && who->GetTypeId() == TYPEID_PLAYER)  // immune to PC and target is a player, return false\n         return false;","path":"src/server/game/Entities/Creature/Creature.cpp","position":9,"original_position":9,"commit_id":"bf94d020a4cb306c766ce0a8a05c99af0413ef8a","original_commit_id":"bf94d020a4cb306c766ce0a8a05c99af0413ef8a","user":{"login":"joschiwald","id":736792,"avatar_url":"https://avatars.githubusercontent.com/u/736792?v=3","gravatar_id":"","url":"https://api.github.com/users/joschiwald","html_url":"https://github.com/joschiwald","followers_url":"https://api.github.com/users/joschiwald/followers","following_url":"https://api.github.com/users/joschiwald/following{/other_user}","gists_url":"https://api.github.com/users/joschiwald/gists{/gist_id}","starred_url":"https://api.github.com/users/joschiwald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joschiwald/subscriptions","organizations_url":"https://api.github.com/users/joschiwald/orgs","repos_url":"https://api.github.com/users/joschiwald/repos","events_url":"https://api.github.com/users/joschiwald/events{/privacy}","received_events_url":"https://api.github.com/users/joschiwald/received_events","type":"User","site_admin":false},"body":"`UNIT_FLAG_IMMUNE_TO_(N)PC` checks are done in `Creature::CanCreatureAttack`\r\nwe could delete this check here?","created_at":"2015-05-27T17:17:09Z","updated_at":"2015-05-27T17:17:09Z","html_url":"https://github.com/TrinityCore/TrinityCore/pull/14780#discussion_r31157384","pull_request_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/14780","_links":{"self":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments/31157384"},"html":{"href":"https://github.com/TrinityCore/TrinityCore/pull/14780#discussion_r31157384"},"pull_request":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/14780"}}},"pull_request":{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/14780","id":36316298,"html_url":"https://github.com/TrinityCore/TrinityCore/pull/14780","diff_url":"https://github.com/TrinityCore/TrinityCore/pull/14780.diff","patch_url":"https://github.com/TrinityCore/TrinityCore/pull/14780.patch","issue_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/14780","number":14780,"state":"open","locked":false,"title":"Core/Creature: UNIT_FLAG_IMMUNE_TO_NPC check only vs non-player targets","user":{"login":"mik1893","id":1483174,"avatar_url":"https://avatars.githubusercontent.com/u/1483174?v=3","gravatar_id":"","url":"https://api.github.com/users/mik1893","html_url":"https://github.com/mik1893","followers_url":"https://api.github.com/users/mik1893/followers","following_url":"https://api.github.com/users/mik1893/following{/other_user}","gists_url":"https://api.github.com/users/mik1893/gists{/gist_id}","starred_url":"https://api.github.com/users/mik1893/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mik1893/subscriptions","organizations_url":"https://api.github.com/users/mik1893/orgs","repos_url":"https://api.github.com/users/mik1893/repos","events_url":"https://api.github.com/users/mik1893/events{/privacy}","received_events_url":"https://api.github.com/users/mik1893/received_events","type":"User","site_admin":false},"body":"closes #14744","created_at":"2015-05-27T15:29:45Z","updated_at":"2015-05-27T17:17:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6316593eebd2c07a08c9b51c20c818b17b18c42","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/14780/commits","review_comments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/14780/comments","review_comment_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/14780/comments","statuses_url":"https://api.github.com/repos/TrinityCore/TrinityCore/statuses/bf94d020a4cb306c766ce0a8a05c99af0413ef8a","head":{"label":"mik1893:immune_to_npc_flag","ref":"immune_to_npc_flag","sha":"bf94d020a4cb306c766ce0a8a05c99af0413ef8a","user":{"login":"mik1893","id":1483174,"avatar_url":"https://avatars.githubusercontent.com/u/1483174?v=3","gravatar_id":"","url":"https://api.github.com/users/mik1893","html_url":"https://github.com/mik1893","followers_url":"https://api.github.com/users/mik1893/followers","following_url":"https://api.github.com/users/mik1893/following{/other_user}","gists_url":"https://api.github.com/users/mik1893/gists{/gist_id}","starred_url":"https://api.github.com/users/mik1893/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mik1893/subscriptions","organizations_url":"https://api.github.com/users/mik1893/orgs","repos_url":"https://api.github.com/users/mik1893/repos","events_url":"https://api.github.com/users/mik1893/events{/privacy}","received_events_url":"https://api.github.com/users/mik1893/received_events","type":"User","site_admin":false},"repo":{"id":35959003,"name":"TrinityCore","full_name":"mik1893/TrinityCore","owner":{"login":"mik1893","id":1483174,"avatar_url":"https://avatars.githubusercontent.com/u/1483174?v=3","gravatar_id":"","url":"https://api.github.com/users/mik1893","html_url":"https://github.com/mik1893","followers_url":"https://api.github.com/users/mik1893/followers","following_url":"https://api.github.com/users/mik1893/following{/other_user}","gists_url":"https://api.github.com/users/mik1893/gists{/gist_id}","starred_url":"https://api.github.com/users/mik1893/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mik1893/subscriptions","organizations_url":"https://api.github.com/users/mik1893/orgs","repos_url":"https://api.github.com/users/mik1893/repos","events_url":"https://api.github.com/users/mik1893/events{/privacy}","received_events_url":"https://api.github.com/users/mik1893/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mik1893/TrinityCore","description":"TrinityCore Open Source MMO Framework","fork":true,"url":"https://api.github.com/repos/mik1893/TrinityCore","forks_url":"https://api.github.com/repos/mik1893/TrinityCore/forks","keys_url":"https://api.github.com/repos/mik1893/TrinityCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mik1893/TrinityCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mik1893/TrinityCore/teams","hooks_url":"https://api.github.com/repos/mik1893/TrinityCore/hooks","issue_events_url":"https://api.github.com/repos/mik1893/TrinityCore/issues/events{/number}","events_url":"https://api.github.com/repos/mik1893/TrinityCore/events","assignees_url":"https://api.github.com/repos/mik1893/TrinityCore/assignees{/user}","branches_url":"https://api.github.com/repos/mik1893/TrinityCore/branches{/branch}","tags_url":"https://api.github.com/repos/mik1893/TrinityCore/tags","blobs_url":"https://api.github.com/repos/mik1893/TrinityCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mik1893/TrinityCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mik1893/TrinityCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/mik1893/TrinityCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mik1893/TrinityCore/statuses/{sha}","languages_url":"https://api.github.com/repos/mik1893/TrinityCore/languages","stargazers_url":"https://api.github.com/repos/mik1893/TrinityCore/stargazers","contributors_url":"https://api.github.com/repos/mik1893/TrinityCore/contributors","subscribers_url":"https://api.github.com/repos/mik1893/TrinityCore/subscribers","subscription_url":"https://api.github.com/repos/mik1893/TrinityCore/subscription","commits_url":"https://api.github.com/repos/mik1893/TrinityCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/mik1893/TrinityCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/mik1893/TrinityCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/mik1893/TrinityCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/mik1893/TrinityCore/contents/{+path}","compare_url":"https://api.github.com/repos/mik1893/TrinityCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mik1893/TrinityCore/merges","archive_url":"https://api.github.com/repos/mik1893/TrinityCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mik1893/TrinityCore/downloads","issues_url":"https://api.github.com/repos/mik1893/TrinityCore/issues{/number}","pulls_url":"https://api.github.com/repos/mik1893/TrinityCore/pulls{/number}","milestones_url":"https://api.github.com/repos/mik1893/TrinityCore/milestones{/number}","notifications_url":"https://api.github.com/repos/mik1893/TrinityCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mik1893/TrinityCore/labels{/name}","releases_url":"https://api.github.com/repos/mik1893/TrinityCore/releases{/id}","created_at":"2015-05-20T16:08:01Z","updated_at":"2015-05-22T09:14:22Z","pushed_at":"2015-05-27T15:38:11Z","git_url":"git://github.com/mik1893/TrinityCore.git","ssh_url":"git@github.com:mik1893/TrinityCore.git","clone_url":"https://github.com/mik1893/TrinityCore.git","svn_url":"https://github.com/mik1893/TrinityCore","homepage":"http://www.trinitycore.org","size":365957,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"6.x"}},"base":{"label":"TrinityCore:3.3.5","ref":"3.3.5","sha":"43ae8727ace4a0bcaaa8665adea78e578be454f3","user":{"login":"TrinityCore","id":539602,"avatar_url":"https://avatars.githubusercontent.com/u/539602?v=3","gravatar_id":"","url":"https://api.github.com/users/TrinityCore","html_url":"https://github.com/TrinityCore","followers_url":"https://api.github.com/users/TrinityCore/followers","following_url":"https://api.github.com/users/TrinityCore/following{/other_user}","gists_url":"https://api.github.com/users/TrinityCore/gists{/gist_id}","starred_url":"https://api.github.com/users/TrinityCore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrinityCore/subscriptions","organizations_url":"https://api.github.com/users/TrinityCore/orgs","repos_url":"https://api.github.com/users/TrinityCore/repos","events_url":"https://api.github.com/users/TrinityCore/events{/privacy}","received_events_url":"https://api.github.com/users/TrinityCore/received_events","type":"Organization","site_admin":false},"repo":{"id":1204412,"name":"TrinityCore","full_name":"TrinityCore/TrinityCore","owner":{"login":"TrinityCore","id":539602,"avatar_url":"https://avatars.githubusercontent.com/u/539602?v=3","gravatar_id":"","url":"https://api.github.com/users/TrinityCore","html_url":"https://github.com/TrinityCore","followers_url":"https://api.github.com/users/TrinityCore/followers","following_url":"https://api.github.com/users/TrinityCore/following{/other_user}","gists_url":"https://api.github.com/users/TrinityCore/gists{/gist_id}","starred_url":"https://api.github.com/users/TrinityCore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrinityCore/subscriptions","organizations_url":"https://api.github.com/users/TrinityCore/orgs","repos_url":"https://api.github.com/users/TrinityCore/repos","events_url":"https://api.github.com/users/TrinityCore/events{/privacy}","received_events_url":"https://api.github.com/users/TrinityCore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TrinityCore/TrinityCore","description":"TrinityCore Open Source MMO Framework","fork":false,"url":"https://api.github.com/repos/TrinityCore/TrinityCore","forks_url":"https://api.github.com/repos/TrinityCore/TrinityCore/forks","keys_url":"https://api.github.com/repos/TrinityCore/TrinityCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TrinityCore/TrinityCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TrinityCore/TrinityCore/teams","hooks_url":"https://api.github.com/repos/TrinityCore/TrinityCore/hooks","issue_events_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/events{/number}","events_url":"https://api.github.com/repos/TrinityCore/TrinityCore/events","assignees_url":"https://api.github.com/repos/TrinityCore/TrinityCore/assignees{/user}","branches_url":"https://api.github.com/repos/TrinityCore/TrinityCore/branches{/branch}","tags_url":"https://api.github.com/repos/TrinityCore/TrinityCore/tags","blobs_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TrinityCore/TrinityCore/statuses/{sha}","languages_url":"https://api.github.com/repos/TrinityCore/TrinityCore/languages","stargazers_url":"https://api.github.com/repos/TrinityCore/TrinityCore/stargazers","contributors_url":"https://api.github.com/repos/TrinityCore/TrinityCore/contributors","subscribers_url":"https://api.github.com/repos/TrinityCore/TrinityCore/subscribers","subscription_url":"https://api.github.com/repos/TrinityCore/TrinityCore/subscription","commits_url":"https://api.github.com/repos/TrinityCore/TrinityCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/TrinityCore/TrinityCore/contents/{+path}","compare_url":"https://api.github.com/repos/TrinityCore/TrinityCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TrinityCore/TrinityCore/merges","archive_url":"https://api.github.com/repos/TrinityCore/TrinityCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TrinityCore/TrinityCore/downloads","issues_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues{/number}","pulls_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls{/number}","milestones_url":"https://api.github.com/repos/TrinityCore/TrinityCore/milestones{/number}","notifications_url":"https://api.github.com/repos/TrinityCore/TrinityCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TrinityCore/TrinityCore/labels{/name}","releases_url":"https://api.github.com/repos/TrinityCore/TrinityCore/releases{/id}","created_at":"2010-12-28T23:40:07Z","updated_at":"2015-05-27T10:15:54Z","pushed_at":"2015-05-27T15:38:12Z","git_url":"git://github.com/TrinityCore/TrinityCore.git","ssh_url":"git@github.com:TrinityCore/TrinityCore.git","clone_url":"https://github.com/TrinityCore/TrinityCore.git","svn_url":"https://github.com/TrinityCore/TrinityCore","homepage":"http://www.trinitycore.org","size":860732,"stargazers_count":2837,"watchers_count":2837,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2945,"mirror_url":null,"open_issues_count":1021,"forks":2945,"open_issues":1021,"watchers":2837,"default_branch":"6.x"}},"_links":{"self":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/14780"},"html":{"href":"https://github.com/TrinityCore/TrinityCore/pull/14780"},"issue":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/14780"},"comments":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/14780/comments"},"review_comments":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/14780/comments"},"review_comment":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/14780/commits"},"statuses":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/statuses/bf94d020a4cb306c766ce0a8a05c99af0413ef8a"}}}}