Skip to content

Bots ride all transport types (trams, lifts/elevators)#265

Merged
billy1arm merged 1 commit intomangoszero:masterfrom
bozimmerman:bots_on_transports
Mar 9, 2026
Merged

Bots ride all transport types (trams, lifts/elevators)#265
billy1arm merged 1 commit intomangoszero:masterfrom
bozimmerman:bots_on_transports

Conversation

@bozimmerman
Copy link
Contributor

@bozimmerman bozimmerman commented Mar 8, 2026

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 Reviewable

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.
Copilot AI review requested due to automatic review settings March 8, 2026 04:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_ONTRANSPORT but m_transport is unset, HandleMoverRelocation now 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.

@AppVeyorBot
Copy link

@billy1arm billy1arm merged commit 6b74faa into mangoszero:master Mar 9, 2026
11 of 12 checks passed
@bozimmerman bozimmerman deleted the bots_on_transports branch March 9, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants