Description:
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Entities/Player/Player.cpp#L1139
and
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Entities/Player/Player.cpp#L1157
At the moment, the target isn't checked for validity when performing melee attacks. As a result, if the target changed faction / flag / etc, while the target was already melee attacked, it is possible for the player to keep melee attacking the target.
I propose to add a IsValidAttackTarget check for melee, need feedback.
Expected behaviour:
Melee attack should get cancelled if the target is not targetable for attack
Steps to reproduce the problem:
- .go creature id 26631
- Right click as to engage combat
- Novos will go unattackable (part of the script), move to melee range, you can melee him (and additionally the script gets broken as a result of the melee)
Branch(es):
CHANGEME 3.3.5 (not sure about master)
TC rev. hash/commit:
0c7655e
Operating system: Doesn't matter
Description:
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Entities/Player/Player.cpp#L1139
and
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Entities/Player/Player.cpp#L1157
At the moment, the target isn't checked for validity when performing melee attacks. As a result, if the target changed faction / flag / etc, while the target was already melee attacked, it is possible for the player to keep melee attacking the target.
I propose to add a IsValidAttackTarget check for melee, need feedback.
Expected behaviour:
Melee attack should get cancelled if the target is not targetable for attack
Steps to reproduce the problem:
Branch(es):
CHANGEME 3.3.5 (not sure about master)
TC rev. hash/commit:
0c7655e
Operating system: Doesn't matter