1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-15 18:57:08 +00:00

Add default physics variables

Co-authored-by: Yoruma <168607605+Mahoyomu@users.noreply.github.com>
This commit is contained in:
1F616EMO 2025-06-15 22:59:43 +08:00
parent 29cfb6efff
commit 3118efdf1c
No known key found for this signature in database
GPG key ID: EF52EFA8E05859B2
4 changed files with 45 additions and 0 deletions

View file

@ -204,3 +204,17 @@ local function run_player_hotbar_clamp_tests(player)
player:hud_set_hotbar_itemcount(old_bar_size)
end
unittests.register("test_player_hotbar_clamp", run_player_hotbar_clamp_tests, {player=true})
--
-- Player defaults physics
--
core.DEFAULT_PHYSICS.speed = 2 -- Slightly change
local function run_player_default_physics_tests(player)
local player_overrides = player:get_physics_override()
assert(player_overrides.speed == 2)
-- Revert everything
core.DEFAULT_PHYSICS.speed = 1
player_overrides.speed = 1
player:set_physics_override(player_overrides)
end
unittests.register("test_player_default_physics", run_player_default_physics_tests, {player=true})