Fix wrong usage of set_physics_override, use playerphysics instead #7
No reviewers
Labels
No Milestone
No project
No Assignees
3 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/mcl_cozy#7
Loading…
Reference in New Issue
No description provided.
Delete Branch "(deleted):fix_phys_override"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
player:set_physics_override takes a table with physics overrides as an argument. According to my research this has been the case at least since minetest 5.0.0. This sets the physics override correctly and fixes warnings (and apparently a crash - see https://codeberg.org/mineclonia/mineclonia/pulls/1134#issuecomment-1567981 )
This also improves interaction with other mods by caching the previously set overrides and restoring them when the player leaves the lay/sit state.
Now I'm not sure what the 3rd argument was supposed to be – gravity? but setting that to 0 doesn't seem to make a lot of sense to me so I left it out. I think setting speed and jump to 0 will probably suffice.
Testing
oh didn't notice #6 when doing this, however I think this variant may be better since it resets to the values set before and not to static 1
Looks good. But then it leaves me wondering how it works with the physics overrides in Mineclone itself... if this is supposed to be specifically for it, shouldn't it just use the playerphysics API?
Pretty sure the goal here is to set it to 0 when the player is sitting or lying and not to a cumulative value like playerphysics would.
This neither changes the values stored in player meta by playerphysics nor set it to potentially something else after it's done (like the current version does).
then again looks like playerphysics multiplies it so could probably work if you put 0
6adbabeabe
to968650dd6b
968650dd6b
to97820be741
amended it
Fix wrong usage of set_physics_overrideto Fix wrong usage of set_physics_override, use playerphysics insteadMerged:
25e3efc9ae