Commit b202ebb8 authored by blert2112's avatar blert2112
Browse files

fix crash

fixed a rare crash when spice timer runs out
parent 7fd276ba
...@@ -93,15 +93,17 @@ if mobs.mod and mobs.mod == "redo" then ...@@ -93,15 +93,17 @@ if mobs.mod and mobs.mod == "redo" then
jump = physics.jump + spice_buff_jump, jump = physics.jump + spice_buff_jump,
gravity = physics.gravity - spice_buff_gravity gravity = physics.gravity - spice_buff_gravity
}) })
minetest.after(spice_duration, function(armorgroups) minetest.after(spice_duration, function(user)
user:set_armor_groups(armorgroups) if user and user:is_player() then
local physics = user:get_physics_override() user:set_armor_groups({immortal = 0})
local phys = user:get_physics_override()
user:set_physics_override({ user:set_physics_override({
speed = physics.speed - spice_buff_speed, speed = phys.speed - spice_buff_speed,
jump = physics.jump - spice_buff_jump, jump = phys.jump - spice_buff_jump,
gravity = physics.gravity + spice_buff_gravity gravity = phys.gravity + spice_buff_gravity
}) })
end, armorgroups) end
end, user)
end end
}) })
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment