From ff04fcbb337209bfe392444c83e889f2a153006b Mon Sep 17 00:00:00 2001 From: asl97 Date: Thu, 28 May 2015 04:10:12 +0800 Subject: [PATCH] Have fire check all neighbor node for interact --- fire.lua | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/fire.lua b/fire.lua index 786c67b..635d9e1 100644 --- a/fire.lua +++ b/fire.lua @@ -1,20 +1,16 @@ -if minetest.get_modpath("fire") and rawget(_G, "fire") then +if minetest.get_modpath("fire") then landrush.default_flame_should_extinguish = fire.flame_should_extinguish function fire.flame_should_extinguish(pos) - corner0 = landrush.can_interact({x=pos.x-1,y=pos.y-1,z=pos.z-1},"-!-") - corner1 = landrush.can_interact({x=pos.x-1,y=pos.y-1,z=pos.z+1},"-!-") - corner2 = landrush.can_interact({x=pos.x-1,y=pos.y+1,z=pos.z-1},"-!-") - corner3 = landrush.can_interact({x=pos.x-1,y=pos.y+1,z=pos.z+1},"-!-") - corner4 = landrush.can_interact({x=pos.x+1,y=pos.y-1,z=pos.z-1},"-!-") - corner5 = landrush.can_interact({x=pos.x+1,y=pos.y-1,z=pos.z+1},"-!-") - corner6 = landrush.can_interact({x=pos.x+1,y=pos.y+1,z=pos.z-1},"-!-") - corner7 = landrush.can_interact({x=pos.x+1,y=pos.y+1,z=pos.z+1},"-!-") - if corner0 and corner1 then - return landrush.default_flame_should_extinguish(pos) - else - return true + for x = -1, 1 do + for y = -1, 1 do + for z = -1, 1 do + if not landrush.can_interact({x=pos.x+x,y=pos.y+y,z=pos.z+z},"-!-") then + return true + end + end + end end + return landrush.default_flame_should_extinguish(pos) end end -