Conversation
|
@bozimmerman Thanks for your PR fixes! Here's a cookie for your hard work! 🍪 |
There was a problem hiding this comment.
Pull request overview
This PR enables pets (hunter pets, warlocks' demons, etc.) to board and ride transports (boats, trams, lifts). It handles boarding from a running summon during transport, loading from the database when the owner is already on a transport, and per-tick following logic so the pet moves naturally around the transport in transport-relative space. An early-return guard in UpdateVisibilityOf prevents the pet from being erroneously unsummoned when it goes out of standard grid range while on a transport.
Changes:
- Added
UpdateCreaturePassengerPositions()toTransport, called eachGlobalTransport::Update()tick to relocate creature passengers to match the transport's world position. - Added
Pet::UpdateTransport()(per-tick boarding/disembarking),Pet::HandleTransportFollow()(transport-relative follow movement), and transport state initialization inPet::LoadPetFromDB(). - Added visibility guards in
Player::UpdateVisibilityOf()and transport cleanup inPlayer::UnsummonPetTemporaryIfAny().
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/game/WorldHandlers/Transports.h |
Declares UpdateCreaturePassengerPositions() as protected helper |
src/game/WorldHandlers/Transports.cpp |
Implements UpdateCreaturePassengerPositions(); refactors TeleportTransport to use a snapshot vector to avoid iterator invalidation |
src/game/WorldHandlers/MovementHandler.cpp |
Trivial blank-line addition |
src/game/Object/Player.cpp |
Adds visibility guards for pets on transports; adds transport cleanup in UnsummonPetTemporaryIfAny |
src/game/Object/Pet.h |
Declares transport state fields and new methods |
src/game/Object/Pet.cpp |
Implements UpdateTransport, HandleTransportFollow, and transport-aware loading in LoadPetFromDB; adds cleanup in Unsummon |
src/game/Object/Creature.h |
Declares HandleTransportFollow virtual method (no-op default) |
src/game/MotionGenerators/TargetedMovementGenerator.cpp |
Intercepts follow movement for transport passengers and delegates to HandleTransportFollow |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
42a24e7 to
c1c7153
Compare
Allows Pets to board and ride boats, trams, lifts, and all other transports. It handles on-transport summons and loads from db. While it uses a similar snap-to-position method to get the Pets on-board (as Bots on Boats did), it also supports following logic, so the Pet may follow its master around the boat in a somewhat natural way. As Mangos lacks mesh info for boats, the following is brute-force, but still looks great imho.
IOW, the implementation of Pets on Transports is better than Bots on Transports, and darn near perfect, but probably needs some minor tweeks in the future to reach perfect parity with old WoW.
This change is