From 663b151decee240e63d2f60827fd1ba7b9f332ad Mon Sep 17 00:00:00 2001 From: Hybrid Dog Date: Thu, 15 Feb 2018 17:44:27 +0100 Subject: [PATCH] Fix spawn_falling_node crash --- src/snowball.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/snowball.lua b/src/snowball.lua index 342e6ab..0a2fcdc 100644 --- a/src/snowball.lua +++ b/src/snowball.lua @@ -194,7 +194,15 @@ function snow_snowball_ENTITY.on_step(self, dtime) {full_punch_interval=1, damage_groups = {fleshy=math.ceil(gain)}} ) minetest.sound_play("default_snow_footstep", {pos=pos, gain=gain}) - spawn_falling_node(pos, {name = "default:snow"}) + + -- spawn_falling_node + local obj = core.add_entity(pos, "__builtin:falling_node") + if obj then + obj:get_luaentity():set_node{name = "default:snow"} + else + minetest.log("error", "Couldn't spawn falling node") + end + self.object:remove() return end