Skip to content

[Adoption] Default physics variables #14859

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Emojigit
Copy link
Contributor

@Emojigit Emojigit commented Jul 16, 2024

This PR is an adoption of #14767. This PR adds a minetest.DEFAULT_PHYSICS table so mods know the default values. The table is compatible with set_physics_override().

Closes #14764

To do

This PR is Ready for Review.

  • minetest.DEFAULT_PHYSICS in Lua API
  • Allow modifying the values

How to test

Run the unit test test_player_default_physics in devtest.

@Emojigit Emojigit changed the title [Adoption] Default physics constants [Adoption] Default physics constants (variables?) Jul 16, 2024
@Zughy
Copy link
Contributor

Zughy commented Jul 16, 2024

My whole point is to allow mods to modify the value. Without, it's pretty useless for me

@Emojigit
Copy link
Contributor Author

My whole point is to allow mods to modify the value. Without, it's pretty useless for me

Done in 917345d. But I wonder if the following code is guaranteed to run before any mods:

https://github.com/minetest/minetest/blob/917345d7e4e6634426a661ac7a4844768dc50fd3/builtin/game/default_physics.lua#L27-L29

@Emojigit Emojigit changed the title [Adoption] Default physics constants (variables?) [Adoption] Default physics variables Jul 16, 2024
@Zughy
Copy link
Contributor

Zughy commented Jul 17, 2024

Wait, the change was already possibile without these commits. What I needed was simply a way to do minetest.DEFAULT_PHYSICS.foo = bar

@Emojigit
Copy link
Contributor Author

Wait, the change was already possibile without these commits

Yeah, only the last commit is meaningful. I kept the previous commits only because I am too lazy to delete them.

@Zughy Zughy added Roadmap The change matches an item on the current roadmap Feature ✨ PRs that add or enhance a feature labels Jul 17, 2024
@SmallJoker SmallJoker added the Rebase needed The PR needs to be rebased by its author label Dec 30, 2024
@Zughy
Copy link
Contributor

Zughy commented Jan 3, 2025

@Emojigit rebase needed

@Emojigit Emojigit marked this pull request as draft January 5, 2025 11:03
@Emojigit Emojigit force-pushed the fork-20240716-default-physics branch from 3909797 to 32c0aa1 Compare January 30, 2025 01:56
@Emojigit Emojigit marked this pull request as ready for review January 30, 2025 01:56
@Emojigit Emojigit force-pushed the fork-20240716-default-physics branch from 32c0aa1 to f31af15 Compare January 30, 2025 02:02
@Emojigit
Copy link
Contributor Author

I have no idea how to fix whitespaces....

@Zughy Zughy removed the Rebase needed The PR needs to be rebased by its author label Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature ✨ PRs that add or enhance a feature Roadmap The change matches an item on the current roadmap @ Script API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

provide a minetest.DEFAULT_PHYSICS value
4 participants