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

Add physics overrides for walk speed and Fast Mode (adoption) #14475

Merged
merged 11 commits into from
Apr 30, 2024

Conversation

grorp
Copy link
Member

@grorp grorp commented Mar 19, 2024

This PR is an adoption of #13815 by Wuzzy2. I rebased and fixed a bug in the backwards compatibility code.

This PR adds the following new fields to set_physics_override:

  • speed_walk: Normal walking speed
  • speed_fast: Speed in Fast Mode
  • acceleration_fast: Acceleration in Fast Mode

With this PR, every player physics value (movement_ settings) will be overridable by Lua.

To do

This PR is a Ready for Review.

How to test

Quoting Wuzzy2:

I recommend you to use luacmd and orienteering mods. Get yourself a speedometer with /giveme orienteering:speedometer and put it in the hotbar. This displays your speed at the top which is very useful for testing.

Now, in DevTest, call me:set_physics_override(table_of_physics_you_want_to_test). Test the normal walk speed and Fast Mode. Also test sneaking and climbing if you want to, just to make sure those still work as expected.
Then check if it does what you expect to / what the documentation promises.

Also test backwards compatibility with all different client/server combinations: this PR / 5.8.0 / pre-5.8.0 on the client + this PR / 5.8.0 / pre-5.8.0 on the server

@grorp grorp added @ Script API Feature ✨ PRs that add or enhance a feature @ Client / Controls / Input Supported by core dev Not on the roadmap, yet some core dev decided to take care of this PR labels Mar 19, 2024
@sfan5 sfan5 self-requested a review April 29, 2024 16:57
src/client/localplayer.cpp Outdated Show resolved Hide resolved
Co-authored-by: sfan5 <sfan5@live.de>
Copy link
Member

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

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

Code looks correct, feel free to merge if tested.

@grorp grorp merged commit 2bdd0a6 into minetest:master Apr 30, 2024
13 checks passed
@grorp grorp deleted the fast_physics_override branch April 30, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Client / Controls / Input Feature ✨ PRs that add or enhance a feature @ Script API Supported by core dev Not on the roadmap, yet some core dev decided to take care of this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants