Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wirelinks getting removed by WireLib.AdjustOutputs #2314

Merged
merged 1 commit into from
Apr 15, 2022

Conversation

Stooberton
Copy link
Contributor

Behavior is inconsistent as existing wires are preserved through an adjustment, but wirelinks are not.

When calling WireLib.AdjustOutputs(entity, nameList), wirelink is not passed. If it were, it'd show up whether an actual wirelink existed or not. It would also be created as NORMAL and not WIRELINK, blocking any attempts to create an actual wirelink.

Proposed fix here just adds wirelink and WIRELINK to names and types if one exists to preserve the wirelink.

@thegrb93
Copy link
Contributor

thegrb93 commented Apr 7, 2022

I think this is ok but I feel like its just working around a different problem. Thoughts @Divran ?

@thegrb93
Copy link
Contributor

thegrb93 commented Apr 7, 2022

Iirc the outputs of an entity shouldn't affect wirelinks at all. A wirelink is essential the entity itself.

@Divran
Copy link
Contributor

Divran commented Apr 7, 2022

Iirc the outputs of an entity shouldn't affect wirelinks at all. A wirelink is essential the entity itself.

Not quite correct. A wirelink is the entity itself yes but it's passed through a wire. Under the hood it's the same thing as an entity output just rebranded.

The problem that this pr fixes is that if an entity runs adjust outputs on itself (which can definitely happen for many reasons such as updating the settings. For example rangers do this) then any wirelink created by other things (such as the wire tool or e2s wirelink function) are removed.

I can't think of a better solution off the top of my head, but I haven't read through the relevant code and I'm writing this on my phone and can't check it right now

@Divran
Copy link
Contributor

Divran commented Apr 7, 2022

Oh by the way, the wire tool can also create entity outputs which would be affected by this in the same way. Could probably fix that too while we're at it

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.

3 participants