Extra error checking.

This commit is contained in:
Duane 2016-07-15 02:58:33 -05:00
parent aa999e2ed5
commit bf26b8bee1
25 changed files with 897 additions and 314 deletions

View file

@ -14,6 +14,10 @@ minetest.register_node("fun_caves:freezing_vapor", {
})
local function snow_effect(pos, radius)
if not (pos and radius and type(radius) == 'number') then
return
end
minetest.add_particlespawner({
amount = 30,
time = 1,
@ -86,6 +90,10 @@ mobs:register_mob("fun_caves:ice_demon", {
animation_speed = 30,
fly_in = 'fun_caves:freezing_vapor',
do_custom = function(self)
if not self then
return
end
-- This has to happen fast.
if self.attack then
self.fly = true
@ -163,6 +171,10 @@ local snow_demon = {
},
animation_speed = 30,
do_custom = function(self)
if not self then
return
end
if not self.attack then
self.fly = false
end
@ -185,9 +197,17 @@ local snow_demon = {
fun_caves.register_status({
name = 'slow_cold',
start = function(player)
if not player then
return
end
player:set_physics_override({speed=0.3})
end,
terminate = function(player)
if not player then
return
end
player:set_physics_override({speed=1})
end,
})