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
[#17019] Targeted movement is now ignored by units with UNIT_FLAG_DIS… #17040
Conversation
Here some sniffs, it looks like the UNIT_FLAG_DISABLE_MOVE is not used |
|
So this Movement flag must be implemented? |
While this PR is open, I'd like to confirm that people like this solution the best as opposed to any alternative and resolve any doubts that came from giving this another look. My understanding of the problem is it's better to cut problem cases off when they're getting their location, since movement generators seem to have more double-checks in their If this change is accepted, I'd also like to apply the same to the other movement generators, since a unit with a "Disable Move" flag should never move at all. Should that similar of a change be made in separate PRs, since this change was originally made for a specific problem (Dark Iron Land Mines), or should the PR be renamed and expanded upon since it is essentially the same pair of lines each time? |
@adeutscher If adeutscher don't answers, anyone can takeover this work? |
Sorry about that. I'll look into the conflicts this weekend. |
Doh, or right now! |
This flag is not meant to be used for generic "disable movement", its related to movement behaving like player or like creature (for example, applying it allows the player to climb steeper hills/wallclimb) |
Could I confirm the location where this is used for steepness/wallclimbing? If this is the case, then the wiki also and good number of other places might also need to be corrected and/or clarified. The comment field for The flag is also used in a few different places in 3.3.5 that suggest to me that it's already being used for disabling movement (code lines not directly involving In the Player and Unit classes, it mostly seems to be used when dealing with flight paths or possession (the possessor gets the flag set for them). For Kel'thuzad (initial aggro?): Talk(SAY_SUMMON_MINIONS);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG
_DISABLE_MOVE | UNIT_FLAG_NOT_SELECTABLE); For Ionar in Halls of Lightning when dispersing: me->AttackStop();
me->SetVisible(false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKAB
LE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_DISABLE_MOVE); Ionar resetting: lSparkList.DespawnAll();
Initialize();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABL
E|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_DISABLE_MOVE); Hodir's Flash Freeze blocks: struct npc_flash_freezeAI : public ScriptedAI
{
npc_flash_freezeAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = me->GetInstanceScript();
me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FL
AG_STUNNED | UNIT_FLAG_PACIFIED);
} It is also already in practice in places like void MotionMaster::MoveChase(Unit* target, float dist, float angle)
{
if (!target || target == _owner || _owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOV
E))
return; In addition, the flag is also set in the database for a number of other
|
All of them are wrong and were assigned by developers basing on the incorrect name. |
I think the real question to be asking is, what do we call it? What is an apt name for it? Does it have a different effect when applied to a creature? This piqued my interest though.
I wonder if this is part of the fear falling through floor/running through mountains problem that I was always stuck with when trying to fix the general Z position problem? For sure, much of it was inappropriate path generation, and the client not being too happy about that generated path. Other oddities were where on the client you seem to be "jumping" through the air. But the generated path definitely had you on ground level. In fact, I think that server side it was never falling through the ground. But, if fear finished at a point the client "thought" it was in a mountain or underground, then the client takes over sending location and thus you're now falling. No idea if it's the case or not. But, something worth looking at, at some point. Unless that flag is already set of course. |
Yep, makes sense. |
Dang. To confirm, if |
Anything that ends up calling Unit::SetRooted (be it SAI or C++ script) is the way to go |
Will do. Going back to |
It's already renamed |
Sorry about that, I should've checked the commit history before putting forward name ponderings. If it's alright with everyone, I'd like to take a stab at tackling all of the spots where the former |
Changes proposed:
Target branch(es): 335, 6.x (?, see note)
Issues addressed: Partial progress towards #17019, though database adjustments are still required (see issue).
This should also make it easier to solve similar cases where a creature summons another creature that is intended to stay in one place. Some similar "Summoned X moves but shouldn't" issues that I could find:
Tests performed:
To add UNIT_FLAG_DISABLE_MOVE to an entry without interfering with any other flags (replace FOO):
unit_flag
value of 4 to Earthgrab Totem (NPC entry 6066, brought up in [3.3.5] "Earthgrab Totem" chases target #15651), and fight a Thistleshrub Rootshaper in Tanaris. The Earthgrab Totem should NOT chase you.Known issues and TODO list: