only set stationSeed from one place#6236
Conversation
|
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:
|
|
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. |
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... |
|
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. |
ca63b17 to
b0e18c1
Compare
|
@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? |
|
You are correct, setting |
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.