X Tutup
Skip to content

Fix traffic control message when starting in space#6220

Merged
impaktor merged 1 commit intopioneerspacesim:masterfrom
zonkmachine:trafficcontrol
Oct 27, 2025
Merged

Fix traffic control message when starting in space#6220
impaktor merged 1 commit intopioneerspacesim:masterfrom
zonkmachine:trafficcontrol

Conversation

@zonkmachine
Copy link
Member

Fixes #6219 by making sure playerInControlledSpace == false when starting in space.

I don't know if there are possible edge cases where this new algorithm wouldn't work. If for instance we start in an orbit around a star but we're still in a controlled space via a space station.

@zonkmachine
Copy link
Member Author

I've tested this some more and it seem to work fine.

@zonkmachine
Copy link
Member Author

Merge?

@impaktor
Copy link
Member

What happens if the player is spawned outside a station? They're not docked, but in controlled space? Or do we not do that?

@zonkmachine
Copy link
Member Author

What happens if the player is spawned outside a station? They're not docked, but in controlled space? Or do we not do that?

Let's find out. Starting in orbit around Phobos:
location = SystemPath.New(0,0,0,0,21),

phobostrafficcontroll

In these cases, what is the expected result? I'm kind of cool with an edge case like this but it could be solved with an extra test for proximity to a station.

@zonkmachine
Copy link
Member Author

I guess in the situation above 27 km from Phobos Base, you wouldn't expect to start with a message like that. I'll fix it.

@zonkmachine
Copy link
Member Author

What happens if the player is spawned outside a station? They're not docked, but in controlled space? Or do we not do that?

Fixed

	elseif Game.player.flightState == "DOCKED" or
			station:DistanceTo(Game.player) < station.lawEnforcedRange then
		playerInControlledSpace = true

@zonkmachine zonkmachine assigned impaktor and unassigned impaktor Oct 17, 2025
@zonkmachine zonkmachine requested a review from impaktor October 17, 2025 13:21
@zonkmachine
Copy link
Member Author

zonkmachine commented Oct 17, 2025

I've tested it some more for possible edge cases but I'm low on ideas. It now works.

(Edit: Both on master and this PR) It doesn't seem to be especially defined what the behavior should be when two stations are really close to each other. You get the message from one when you enter the area and then a goodby from the other when you exit after having transited from the first one. You will not get any traffic messages when moving in between the however. This is not a great problem. You could perhaps make control zones of stations smaller when they overlap but that may be just unnecessary noise. Maybe a different message could be used. "Now leaving 'x', we hand you over to 'y'. Something like that.

@zonkmachine
Copy link
Member Author

Merge?

Copy link
Member

@impaktor impaktor left a comment

Choose a reason for hiding this comment

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

I've not tested it, but looks fine when I ran the proposed changes in the software on my wetware (brain), it did not explode.

@zonkmachine zonkmachine requested a review from impaktor October 26, 2025 19:53
@impaktor impaktor merged commit 263b73b into pioneerspacesim:master Oct 27, 2025
@zonkmachine zonkmachine deleted the trafficcontrol branch October 27, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StationTrafficControl.lua - 'Leaving controlled space' message when starting in space

2 participants

X Tutup