From 9eba0e4860f570363cfec992994b466521178a5b Mon Sep 17 00:00:00 2001 From: kabou Date: Fri, 18 Mar 2022 11:39:11 +0100 Subject: [PATCH] Remove unused code. * Remove unused code that was commented out. The code tried to find fire luaentities in the same spot as the newly created fire luaentity. It may have been intended to optimize getting set on fire multiple times, but it makes no sense as it does not discriminate between fire luaentities attached to the object set on fire and those attached to other objects. The function that this code was in also has a better way to prevent adding multiple fire luaentities in the first place. --- mods/ENTITIES/mcl_burning/api.lua | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/mods/ENTITIES/mcl_burning/api.lua b/mods/ENTITIES/mcl_burning/api.lua index 3fcc7778f..885875aca 100644 --- a/mods/ENTITIES/mcl_burning/api.lua +++ b/mods/ENTITIES/mcl_burning/api.lua @@ -131,19 +131,6 @@ function mcl_burning.set_on_fire(obj, burn_time) if obj:is_player() then mcl_burning.update_hud(obj) end - - --[[ - -- FIXME: does this code make sense? It removes attached fire luaentities from - -- another object that happen to be at the same position. - local fire_luaentity = fire_entity:get_luaentity() - for _, other in pairs(minetest.get_objects_inside_radius(fire_entity:get_pos(), 0)) do - local other_luaentity = other:get_luaentity() - if other_luaentity and other_luaentity.name == "mcl_burning:fire" and other_luaentity ~= fire_luaentity then - other:remove() - break - end - end - ]]-- end function mcl_burning.extinguish(obj)