From da81f0b5b44f3624310de00eb649ee8d31150206 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 8 Aug 2022 10:32:32 -0500 Subject: [PATCH] Cache output of function to variable then call it --- mods/ENTITIES/mcl_mobs/api/mob_functions/head_logic.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/head_logic.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/head_logic.lua index 9a496a567..57b9c513e 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/head_logic.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/head_logic.lua @@ -24,7 +24,8 @@ mobs.do_head_logic = function(self, dtime, player) local head_offset = vector.multiply(body_dir, self.head_direction_offset) pos = vector.add(pos, head_offset) - if minetest.settings:get_bool("mcl_debug_head_code", false) then + local debug_head = minetest.settings:get_bool("mcl_debug_head_code", false) + if debug_head then minetest.add_particle({ pos = pos, velocity = {x=0, y=0, z=0},