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

Compatiblilty with larger drills #11

Merged
merged 3 commits into from
Nov 20, 2021
Merged

Compatiblilty with larger drills #11

merged 3 commits into from
Nov 20, 2021

Conversation

nicolas-lang
Copy link
Collaborator

@nicolas-lang nicolas-lang commented Aug 13, 2021

Based on the report at the mods portal, I have modified the pipe building to be based on the fluid box prototype instead being hardcoded.

I have done a couple of tests with the bigger AAI drills and it seems to be working fine. Unfortunately nobody in the mod portal forums offered test-feedback.

While I like the general structure of the new logic there are two places where I am unsure:
1.
local fluidbox_prototype = drill.fluidbox.get_prototype(1) is this the way to get the correct fluid box, or would using game.entity_prototypes[drill.name] (and then go to the members) be more correct...
2.
autodeconstruct.build_pipe(drillData, pipeType, conn.positions[1])
... why has the fluidbox prototype an array for each connection even though the drill was only created with a single location for the connection. This seems strange but works...

I'll just open it as a pull request for now, maybe you can also have a look.

A pre-realease test package (zip) is available at https://github.com/nicolas-lang/AutoDeconstruct/releases

P.S. ( I was busy and the invite timed out)

@robot256
Copy link
Collaborator

This PR also addresses #14. Just one comment, in your addition to find_all_entities, line 25 should be continue, not break, so that it keeps iterating over any remaining valid surfaces. (I've never had the game give me an invalid surface object, but you never know.)

@nicolas-lang
Copy link
Collaborator Author

nicolas-lang commented Nov 19, 2021

there is no continue in lua, but I'll have a look to maybe change the if then a bit

@robot256
Copy link
Collaborator

Oh yes, my bad. I'll test this tomorrow! Would be great for it to work with the miners in my Space Exploration game.

@robot256
Copy link
Collaborator

I have tested that the surface checking code works, both when upgrading the mod and when adding it to an existing save. The fluid box code also works with 3x3 miners. Haven't tested it with larger ones yet.

@softmix softmix merged commit 3751c9b into softmix:master Nov 20, 2021
@softmix
Copy link
Owner

softmix commented Nov 21, 2021

Thank you for this

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