mirror of
https://github.com/minetest-mods/hbsprint.git
synced 2025-01-08 21:27:35 +01:00
fix occasional crash possibly due to unknown node
This commit is contained in:
parent
577e1a330b
commit
4539d965ed
3
init.lua
3
init.lua
@ -173,8 +173,11 @@ minetest.register_globalstep(function(dtime)
|
|||||||
hunger = tonumber(player:get_attribute("hunger_ng:hunger"))
|
hunger = tonumber(player:get_attribute("hunger_ng:hunger"))
|
||||||
end
|
end
|
||||||
if ground ~= nil then
|
if ground ~= nil then
|
||||||
|
local ground_def = minetest.registered_nodes[ground.name]
|
||||||
|
if ground_def then
|
||||||
walkable = minetest.registered_nodes[ground.name].walkable
|
walkable = minetest.registered_nodes[ground.name].walkable
|
||||||
end
|
end
|
||||||
|
end
|
||||||
if player_stamina > 0 and hunger > 6 and walkable then
|
if player_stamina > 0 and hunger > 6 and walkable then
|
||||||
start_sprint(player)
|
start_sprint(player)
|
||||||
player:set_attribute("hbsprint:sprinting", "true")
|
player:set_attribute("hbsprint:sprinting", "true")
|
||||||
|
Loading…
Reference in New Issue
Block a user