X Tutup
Skip to content

only set stationSeed from one place#6236

Merged
sturnclaw merged 1 commit intopioneerspacesim:masterfrom
zonkmachine:paintshopseed
Nov 21, 2025
Merged

only set stationSeed from one place#6236
sturnclaw merged 1 commit intopioneerspacesim:masterfrom
zonkmachine:paintshopseed

Conversation

@zonkmachine
Copy link
Member

@zonkmachine zonkmachine commented Oct 29, 2025

In response to #6225
I'm not sure it's a fix yet but 'stationSeed' shouldn't be set on two different places. If it's set via determinePaintshopAvailability() then, when either of refresh(), drawPaintshop() or drawShipRepair() is executed and there are no face, the face will not be generated. It's not obvious to me yet when refresh() is called. In any case, this is only a proplem on bodies with smaller populations.
#6225 states that the missing faces are on bot the lobby and the mechanic and this would not be explained by this find/fix. However, I'm unsure if I have tested this correctly as my local test branch I used to test this bug with debug statements accidentally had a fix built in, so it essentially sent me to intermittent hell with the issue suddenly gone. We must assume the possibility that the rest of my trouble shooting lived up to the same quality.

A draft for now.

@zonkmachine
Copy link
Member Author

I have found no way to faithfully reproduce the issues but one way to make the mechanic to disappear with some success rate seem to be:

  • Go to Phobos
  • Visit the Repair Shop
  • Enter the Paint Shop
  • Close Pioneer (Alt + F4)
  • Resume game
  • Visit Repair Shop which now most likely don't have the staff present

@zonkmachine zonkmachine marked this pull request as draft October 29, 2025 16:43
@sturnclaw
Copy link
Member

Ehhh... You might be better served refactoring the module to remove the dependence on the file-scope global stationSeed variable and instead pass it as a direct dependency to the various functions. That kind of global state is a huge bug vector.

Haven't dug much further into the module, but you should be safe to assume that station.seed is valid (though maybe not always nonzero) as I recall improving the consistency of seed generation in previous system-gen PRs.

@zonkmachine
Copy link
Member Author

... refactoring the module to remove the dependence on the file-scope global stationSeed variable and instead pass it as a direct dependency to the various functions.

I'm just starting to get confident with the mission modules and the views have a different 'feel' to them. I'm pretty lost here right now. Spontaneously, I could maybe touch up the Issue instead and focus on some other part of the code that I know better. A tactical retreat...

@sturnclaw
Copy link
Member

Having taken a closer look at the module, this is a good change on the face of it.

Refresh is called when switching to the specific view tab within the station view - it should also be called when the station view is opened with that tab already active (though don't quote me on that). The view table specifies a draw function which renders the module (probably drawPaintshop) and the refresh function is meant to be used to refresh state that may have changed while the player is on other views.

@zonkmachine
Copy link
Member Author

@sturnclaw I don't know what to do here. The way I understand the code, the stationSeed shouldn't be set in determinePaintshopAvailability() and this PR fixes that. It tests fine on my side. I can reproduce the issue with high confidence and the fix works for me 100%. Anything more advanced, well, probably someone else should take over the

Merge/Close/Someone else takes over?

@zonkmachine zonkmachine marked this pull request as ready for review November 21, 2025 17:16
@sturnclaw
Copy link
Member

You are correct, setting stationSeed here is invalid regardless of the context of any other issues with the module. I'll merge this and we can address the general module design at a later date (read: probably never).

@sturnclaw sturnclaw merged commit 0fd2479 into pioneerspacesim:master Nov 21, 2025
@zonkmachine zonkmachine deleted the paintshopseed branch November 21, 2025 21:25
@sturnclaw sturnclaw mentioned this pull request Jan 5, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup