mirror of
https://git.minetest.land/Mineclonia/Mineclonia.git
synced 2024-11-24 09:35:10 +00:00
Move variable declaration out of loops to increase performance.
This commit is contained in:
parent
1dda98fa4c
commit
64a2a6bb53
1 changed files with 2 additions and 2 deletions
|
@ -264,7 +264,6 @@ local is_fire_node = { ["mcl_core:lava_flowing"]=true,
|
|||
["mcl_nether:nether_lava_flowing"]=true,
|
||||
["mcl_nether:nether_lava_source"]=true}
|
||||
|
||||
|
||||
-- Prevent damage to player with Fire Resistance enabled
|
||||
minetest.register_on_player_hpchange(function(player, hp_change, reason)
|
||||
|
||||
|
@ -344,9 +343,10 @@ minetest.register_on_dieplayer( function(player) mcl_potions._reset_player_effec
|
|||
|
||||
function mcl_potions.is_obj_hit(self, pos)
|
||||
|
||||
local entity
|
||||
for _,object in pairs(minetest.get_objects_inside_radius(pos, 1.1)) do
|
||||
|
||||
local entity = object:get_luaentity()
|
||||
entity = object:get_luaentity()
|
||||
|
||||
if entity and entity.name ~= self.object:get_luaentity().name then
|
||||
|
||||
|
|
Loading…
Reference in a new issue