Skip to content

Refactor player transfers#2851

Merged
daid merged 7 commits into
daid:masterfrom
oznogon:2848-2849-2850-refactor-player-transfer
Jun 5, 2026
Merged

Refactor player transfers#2851
daid merged 7 commits into
daid:masterfrom
oznogon:2848-2849-2850-refactor-player-transfer

Conversation

@oznogon

@oznogon oznogon commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

oznogon added 2 commits April 9, 2026 17:06
GuiRadarView initializes auto_center_target from my_spaceship at
construction but never updates it. After transferPlayersToShip() moves
a player to a new ship, radar views remained centered on the old ship
until the player logs out and back in.

Add a track_my_spaceship flag that keeps auto_center_target in sync
with my_spaceship each frame when true (default). Calling
setAutoCenterTarget() clears the flag, preserving behaviours that
temporarily lock onto an arbitrary target, like Spectator.
- If transferring a player in a position prohibited on the destination
  entity, move the player to an allowed position and log a warning.
  If the destination has no allowed positions, log an error and reset
  the destination's allowed positions to any.
- If transferring to a ship that lacks a PlayerControl component, add
  it.
- If transferring to a ship that has an AIController component, remove
  it.
Comment thread src/script.cpp Outdated
Comment thread src/script.cpp Outdated
Comment thread src/script.cpp Outdated
Comment thread src/script.cpp Outdated
Comment thread src/script.cpp Outdated
Co-authored-by: Garrett Guillotte <oznogon@users.noreply.github.com>
@oznogon oznogon marked this pull request as draft June 3, 2026 01:03
@oznogon oznogon requested a review from GinjaNinja32 June 3, 2026 01:04
@oznogon oznogon marked this pull request as ready for review June 3, 2026 01:17
Comment thread src/screenComponents/radarView.h Outdated
@oznogon oznogon requested a review from daid June 4, 2026 18:15
const GuiThemeStyle* ship_waypoint_style;
const GuiThemeStyle* ship_waypoint_background_style;
const GuiThemeStyle* ship_waypoint_text_style;
const GuiThemeStyle* radar_style = theme->getStyle("radar");

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I'm surprised that this work, but, I do like that we removed a whole bunch of duplication :)

@daid daid merged commit 4c364a8 into daid:master Jun 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants