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

[mesecons_doors] Improve code quality and fix Voxelgarden support #671

Merged
merged 2 commits into from
May 20, 2024

Conversation

rudzik8
Copy link
Contributor

@rudzik8 rudzik8 commented May 15, 2024

The main code quality improvement here is the functionalization of code: now trapdoors are also overriden using their own function, and both meseconify_door and meseconify_trapdoor are now ran inside for loops with local lists of base node names. In the future, this could help refactor this mod entirely to not list doors manually but parse through the doors.registered_* variables, ensuring that every door works.

As a nice bonus, Voxelgarden support is fixed, and potentially so is support for other games with exotic implementations of the doors mod. No longer are we assuming that the existence of doors.get means that all the trapdoors exist too; now, if the meseconify function doesn't find their definition, it just returns without crashing.

P.S. And yes, I'm the current Voxelgarden maintainer.

The main code quality improvement here is the functionalization of code:
now trapdoors are also overriden using their own function, and both
meseconify_door and meseconify_trapdoor are now ran inside for loops
with local lists of base node names. In the future, this could help
refactor this mod entirely to not list doors manually but parse through
the doors.registered_* variables, ensuring that every door works.

As a nice bonus, Voxelgarden support is fixed, and potentially so is
support for other games with exotic implementations of the doors mod. No
longer are we assuming that the existence of doors.get means that all
the trapdoors exist too; now, if the meseconify function doesn't find
their definition, it just returns without crashing.
mesecons_doors/init.lua Outdated Show resolved Hide resolved
@rudzik8 rudzik8 requested a review from SmallJoker May 16, 2024 06:40
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. Tested xpanes and doors. Will merge in a few days unless there are objections in the meantime.

@SmallJoker SmallJoker merged commit a82bac7 into minetest-mods:master May 20, 2024
2 checks 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.

None yet

2 participants