Skip to content
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

Improve PathFinder/TargetedMovementGenerator #2853

Open
wants to merge 6 commits into
base: development
Choose a base branch
from

Conversation

Stoabrogga
Copy link
Contributor

@Stoabrogga Stoabrogga commented Dec 23, 2024

🍰 Pullrequest

  1. Ensure that the Z coordinates of the calculated path are correct. This is similar to what Cmangos and Trinitycore do:
    https://github.com/cmangos/mangos-classic/blob/e593dbcde632ffc4ba04e82ffc01a51695d578a8/src/game/MotionGenerators/PathFinder.cpp#L983
    https://github.com/TrinityCore/TrinityCore/blob/7f5790db6701a46b06b2c3319c3776c1fb93e3d5/src/server/game/Movement/PathGenerator.cpp#L596
  2. Improve TargetedMovementGenerator for following pets
  3. Fix TerrainInfo::GetWaterOrGroundLevel (can create values below ground level)
  4. Remove unused variable in MoveSplineInit.cpp

Proof

see #2726

Issues

fixes #2726

How2Test

Run around with warlock or hunter pets.

Todo / Checklist

none

@ratkosrb
Copy link
Contributor

Does this work correctly for flying and swimming mobs?

@ShiyoKozuki
Copy link
Contributor

ShiyoKozuki commented Dec 24, 2024

Does this work correctly for flying and swimming mobs?

Not sure if this is related but...
On classic, mobs "run away in fear" and will path into water and swim away (if they started on land before running away).
On vmangos, they will never path into water/swim when "run away in fearing"ing (if they started on land before running away).

@Stoabrogga
Copy link
Contributor Author

Does this work correctly for flying and swimming mobs?

Flying or swimming creatures do not use pathfinding at all, they use shortcuts (2 point paths) and unlike Cmangos and TC I intentionally omitted the z correction there because it should only apply to calculated paths.

@ShiyoKozuki This is not related, you should open an issue if the creature behavior is wrong.

@Stoabrogga Stoabrogga changed the title Improve PathFinder Improve PathFinder/TargetedMovementGenerator Dec 29, 2024
@Stoabrogga
Copy link
Contributor Author

Added a few other fixes concerning #2726, see first comment.

Ensure that speed is not 0
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] Pet follow movement
3 participants