From 908ba9fba6400e08e61b11e183b3f5c31eaca59f Mon Sep 17 00:00:00 2001 From: epCode Date: Tue, 30 May 2023 19:54:24 -0700 Subject: [PATCH] Put on_replace call in correct place (wool regrow on grass to dirt) --- mods/ENTITIES/mcl_mobs/movement.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/movement.lua b/mods/ENTITIES/mcl_mobs/movement.lua index 99b1fdf89..c165bdf89 100644 --- a/mods/ENTITIES/mcl_mobs/movement.lua +++ b/mods/ENTITIES/mcl_mobs/movement.lua @@ -513,11 +513,8 @@ function mob_class:replace_node(pos) local oldnode = {name = what, param2 = node.param2} local newnode = {name = with, param2 = node.param2} - local on_replace_return + local on_replace_return = true - if self.on_replace then - on_replace_return = self.on_replace(self, pos, oldnode, newnode) - end if on_replace_return ~= false then @@ -529,6 +526,9 @@ function mob_class:replace_node(pos) if self and self.object and not self.dead then self.object:set_velocity(vector.new(0,0,0)) minetest.set_node(pos, newnode) + if self.on_replace then + on_replace_return = self.on_replace(self, pos, oldnode, newnode) + end end end) minetest.after(2.5, function()