Skip to content

Prevent visual bug on older clients where mobs appear to teleport to player - #3533

Merged
ratkosrb merged 1 commit into
vmangos:developmentfrom
moyashiparty:fix-buggy-movement-for-old-clients
Aug 20, 2026
Merged

Prevent visual bug on older clients where mobs appear to teleport to player#3533
ratkosrb merged 1 commit into
vmangos:developmentfrom
moyashiparty:fix-buggy-movement-for-old-clients

Conversation

@moyashiparty

Copy link
Copy Markdown
Contributor

🍰 Pullrequest

If a mob breaks out of root or stun, and the player has moved away, the mobs will appear to teleport beside the player (presumably to the end location of their existing movement spline?) on clients 1.6.1 and older.

Now I really have no idea if this fix is proper or not... Honestly, I've had sporadic attempts fixing this problem for years now without any luck, but I was getting annoyed at how irritating it was to AoE farm mobs with this bug present so I sat down for a few hours tonight trying random shit until surprisingly this worked. Maybe it'll get the ball rolling on a real fix, or maybe the conditional StopMoving is good enough of an improvement for the older clients.

Feel free to just close this if there's a better solution.

Proof

Before (stun):
https://github.com/user-attachments/assets/5f22ad07-1b46-42a2-b2d2-f281bd1b6801

Before (root):
https://github.com/user-attachments/assets/8d2e6b26-e687-4f2a-90b5-d07c22782a0b

After (stun):
https://github.com/user-attachments/assets/a1f8b9c6-9ee4-46d5-91b4-479150e4266d

After (root):
https://github.com/user-attachments/assets/6b56f68d-6240-4f82-a001-1ab0d00494bc

Issues

How2Test

  • Use an older client (I've seen this happen on 1.6.1 and 1.5.1)
  • Stun or root a mob
  • Move away from the mob while it is stunned/rooted
  • Most of the time (not always) it will appear to teleport beside you when the stun/root breaks

@ratkosrb

Copy link
Copy Markdown
Contributor

It seems that the next movement spline starting too soon after the unroot trips up the client. In the 1.8 sniffs it's the same packet used to unroot the creature (MSG_MOVE_UNROOT) but it only begins chasing again on the next world update. In our core it happens immediately after, Unit::Update updates MotionMaster after it's updated the auras (where unroot happens).

@ratkosrb

Copy link
Copy Markdown
Contributor

Can you move the hackfix inside Unit:SetRooted so we don't duplicate the code? And we shouldn't check for combat, cause the teleport bug can affect any kind of movement that begins right after root ends.

image

@moyashiparty
moyashiparty force-pushed the fix-buggy-movement-for-old-clients branch from 530c3eb to 1cd14e4 Compare August 19, 2026 07:47
@moyashiparty

Copy link
Copy Markdown
Contributor Author

Can you move the hackfix inside Unit:SetRooted so we don't duplicate the code? And we shouldn't check for combat, cause the teleport bug can affect any kind of movement that begins right after root ends.

Sure I made that change and included your comment, also confirmed it still fixes the issue for me.

@moyashiparty
moyashiparty force-pushed the fix-buggy-movement-for-old-clients branch from 1cd14e4 to e338cb6 Compare August 19, 2026 07:53
Comment thread src/game/Objects/Unit.cpp Outdated
SetRootedReal(apply);
MovementPacketSender::SendMovementFlagChangeToAll(this, MOVEFLAG_ROOT, apply);

// Hackfix: Old clients teleport unit to last point if new spline begins right after uproot.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo uproot instead of unroot

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not able to edit it myself, my browser doesn't support the web editor anymore, I need you to fix the typo before I can merge it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep fixed, sorry about that

If a mob breaks out of root or stun, and the player has moved away,
the mobs will appear to teleport beside the player (presumably to
the end location of their movement spline) on older clients.
@moyashiparty
moyashiparty force-pushed the fix-buggy-movement-for-old-clients branch from e338cb6 to b946ec8 Compare August 20, 2026 08:13
@ratkosrb
ratkosrb merged commit 5a30f33 into vmangos:development Aug 20, 2026
Stoabrogga pushed a commit to Stoabrogga/vmangos that referenced this pull request Aug 21, 2026
…angos#3533)

If a mob breaks out of root or stun, and the player has moved away, the mobs will appear to teleport beside the player (presumably to the end location of their movement spline) on older clients.

(cherry picked from commit 5a30f33)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐜 [Bug][1.6.1] Mob teleport to the new highest hate player's side instantly when mob's hate transfer to other player.

2 participants