New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[335] Pets drop target after every pet spell cast #16824
Comments
This is maybe releated to #15641 This line got changed which might be the problem: https://github.com/TrinityCore/TrinityCore/pull/15641/files#diff-f3f953a63e2a008d22de69cb68f735c4R2787 I'm not 100% sure but i will run some tests and post back :) |
Okay yea it was really that change. The following fixes the problem: diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 1f7dae4..893d33a 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -2872,7 +2872,10 @@ void Creature::ReleaseFocus(Spell const* focusSpell, bool withDelay)
if (focusSpell && focusSpell != _focusSpell)
return;
- SetGuidValue(UNIT_FIELD_TARGET, ObjectGuid::Empty);
+ if (Unit* victim = GetVictim())
+ SetGuidValue(UNIT_FIELD_TARGET, victim->GetGUID());
+ else
+ SetGuidValue(UNIT_FIELD_TARGET, ObjectGuid::Empty);
if (_focusSpell->GetSpellInfo()->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST))
ClearUnitState(UNIT_STATE_CANNOT_TURN);
Let me summon @Treeston Maybe he can explain why this was changed. And if it is okay to revert this line without changing/breaking something else. |
If you re-target right away facing (and spell anim) will snap back to that target immediately (Ingvar etc). that's what the retargeting delay code prevents. Delay behavior shouldn't apply to pets though, that's the bug here. Let me test & push a fix. |
… after spell cast. Closes TrinityCore#16824.
… after spell cast. Closes TrinityCore#16824.
Description:
Pets drop their target whenever they autocast a spell and reacquire it on next attack. This makes /assist macros buggy.
Current behaviour:
When you send your pet to attack, you will see a targeting ring on the mob's feet. When the pet casts, for example, claw, the pet will lose the target and on its next attack the targeting ring will appear again. During this "downtime", /assist macros fail becaus the pet has no target.
Expected behaviour:
Pets should not lose targets after every attack.
Steps to reproduce the problem:
Branch(es): 335
TC hash/commit: cebdf03
TDB version: TDB_full_world_335.60_2015_11_07.sql
Operating system: Windows XP and Windows 7
The text was updated successfully, but these errors were encountered: