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

power multiplication fix #655

Merged
merged 8 commits into from
Nov 29, 2024

Conversation

SomeName42
Copy link
Contributor

Fixed power multiplication bug. Resolves #277. The cause of the bug was that machines can be a part of multiple networks and generate power for each of the networks. This was fixed by checking if machine is already part of an other network and not making it a part of the current one. When network times out the network meta string value is cleared and the clear_networks function is used to try to connect the machine to a different network.

SomeName42 added 3 commits November 16, 2024 16:01
… of the bug was that machines can be a part of multiple networks and generate power for each of the networks. This was fixed by checking if machine is already part of an other network and not making it a part of the current one. When network times out the network meta string value is cleared and the clear_networks function is used to try to connect the machine to a different network.
SomeName42 added 4 commits November 17, 2024 17:04
…mproved clear_networks function fixed network not being cleared in some cases. Moved new network finding for machines to when network is cleared instead of on timeout.
Copy link
Member

@SmallJoker SmallJoker left a comment

Choose a reason for hiding this comment

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

Works well so far. Connected and disconnected a few cables. The machines are updated correctly.

technic/machines/register/cables.lua Outdated Show resolved Hide resolved
technic/machines/register/cables.lua Outdated Show resolved Hide resolved
technic/machines/switching_station.lua Show resolved Hide resolved
technic/machines/register/cables.lua Outdated Show resolved Hide resolved
technic/machines/register/cables.lua Outdated Show resolved Hide resolved
…esarily checking technic.network[network_id] for nil, moved network_id nil checking inside clear_network function
Copy link
Member

@SmallJoker SmallJoker left a comment

Choose a reason for hiding this comment

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

Thank you for the update.
Works. Will merge in a few days unless there are objections.

@SmallJoker SmallJoker merged commit b268e3d into minetest-mods:master Nov 29, 2024
1 check passed
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.

Power Doubling Bug
2 participants