{"action":"created","issue":{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/16786","repository_url":"https://api.github.com/repos/TrinityCore/TrinityCore","labels_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/16786/labels{/name}","comments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/16786/comments","events_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/16786/events","html_url":"https://github.com/TrinityCore/TrinityCore/pull/16786","id":140812236,"number":16786,"title":"Core/AI Remove Reset() call from JustRespawned() hook","user":{"login":"sirikfoll","id":11219553,"avatar_url":"https://avatars.githubusercontent.com/u/11219553?v=3","gravatar_id":"","url":"https://api.github.com/users/sirikfoll","html_url":"https://github.com/sirikfoll","followers_url":"https://api.github.com/users/sirikfoll/followers","following_url":"https://api.github.com/users/sirikfoll/following{/other_user}","gists_url":"https://api.github.com/users/sirikfoll/gists{/gist_id}","starred_url":"https://api.github.com/users/sirikfoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirikfoll/subscriptions","organizations_url":"https://api.github.com/users/sirikfoll/orgs","repos_url":"https://api.github.com/users/sirikfoll/repos","events_url":"https://api.github.com/users/sirikfoll/events{/privacy}","received_events_url":"https://api.github.com/users/sirikfoll/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/labels/Comp-Core","name":"Comp-Core","color":"FF6600"},{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/labels/Feedback-PatchFix","name":"Feedback-PatchFix","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-14T22:15:34Z","updated_at":"2016-03-15T10:39:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/16786","html_url":"https://github.com/TrinityCore/TrinityCore/pull/16786","diff_url":"https://github.com/TrinityCore/TrinityCore/pull/16786.diff","patch_url":"https://github.com/TrinityCore/TrinityCore/pull/16786.patch"},"body":"**Changes proposed**:\r\n\r\n- With the current implementation Reset() hook is called twice at creature respawn\r\n- So, I propose to remove it from JustRespawned()\r\n- Why this shouldn't break anything:\r\n- Reset is called at creature spawn in https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/AI/CoreAI/UnitAI.h#L130\r\n- Reset is called at creature respawn in https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Entities/Creature/Creature.cpp#L1718\r\n\r\n**Target branch(es)**: 335/6x\r\n\r\n**Issues addressed**: Fixes #16672\r\n\r\n**Tests performed**: Built and tested\r\n\r\n**Known issues and TODO list**:\r\n\r\n- Didn't found any so far"},"comment":{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/comments/196760679","html_url":"https://github.com/TrinityCore/TrinityCore/pull/16786#issuecomment-196760679","issue_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/16786","id":196760679,"user":{"login":"sirikfoll","id":11219553,"avatar_url":"https://avatars.githubusercontent.com/u/11219553?v=3","gravatar_id":"","url":"https://api.github.com/users/sirikfoll","html_url":"https://github.com/sirikfoll","followers_url":"https://api.github.com/users/sirikfoll/followers","following_url":"https://api.github.com/users/sirikfoll/following{/other_user}","gists_url":"https://api.github.com/users/sirikfoll/gists{/gist_id}","starred_url":"https://api.github.com/users/sirikfoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirikfoll/subscriptions","organizations_url":"https://api.github.com/users/sirikfoll/orgs","repos_url":"https://api.github.com/users/sirikfoll/repos","events_url":"https://api.github.com/users/sirikfoll/events{/privacy}","received_events_url":"https://api.github.com/users/sirikfoll/received_events","type":"User","site_admin":false},"created_at":"2016-03-15T10:39:17Z","updated_at":"2016-03-15T10:39:17Z","body":"like log in and test if it solved the main problem and debug a spawn and respawn sittuation to check if the call is happening yet.\r\nI just can't think in any way this can break anything.\r\nThe only way Reset will not be called is if we override InitializeAI() and only for the spawn sittuation, and this behavior exists without this PR.\r\nReset will still be called at respawn by https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Entities/Creature/Creature.cpp#L1718 regardless if I override InitilizeAI() or JustRespawned() or anything else, as it already happens without this PR too.\r\nThe only change is that it will be callled once, instead of twice."}}