Bots ride all transport types (trams, lifts/elevators)#265
Merged
billy1arm merged 1 commit intomangoszero:masterfrom Mar 9, 2026
Merged
Bots ride all transport types (trams, lifts/elevators)#265billy1arm merged 1 commit intomangoszero:masterfrom
billy1arm merged 1 commit intomangoszero:masterfrom
Conversation
Bot-following-on-transport was already implemented for ships (PR mangoszero#239), but relied on master->GetTransport() which only searched the global transport list. Trams and lifts are LocalTransports stored per-map in Map::i_transports, so GetTransport() always returned NULL for them and bots never boarded. Adds GetLocalTransports() to Map and falls back to it in MovementHandler when the global search finds no match. The existing follow logic then works for all transport types unchanged.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands movement/transport passenger resolution so bots (and players) can correctly associate MOVEFLAG_ONTRANSPORT movement packets with local (per-map) transports like lifts/elevators and the Deeprun Tram.
Changes:
- When a player has
MOVEFLAG_ONTRANSPORTbutm_transportis unset,HandleMoverRelocationnow also searches the current map’s local transports for the transport GUID. - Added a
Map::GetLocalTransports()accessor to expose the per-map transport container.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/game/WorldHandlers/MovementHandler.cpp |
Adds a fallback lookup against per-map local transports and boards the matching transport. |
src/game/WorldHandlers/Map.h |
Exposes i_transports via a const accessor so movement code can query local transports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This expands Bot ride support to trams and lifts. I knew it would be easy -- I didn't realize it would be trivial. As the longer commit message mentioned, it was just a matter of checking local transports.
This change is