From c6fc3885972f6ad55eb173b79c1e1c33c0ca8603 Mon Sep 17 00:00:00 2001 From: cora Date: Fri, 18 Nov 2022 07:26:44 +0100 Subject: [PATCH] Add _harmless option for rocket arrows so event fireworks dont grief things --- mods/ENVIRONMENT/mcl_raids/init.lua | 8 ++++++-- mods/ITEMS/mcl_bows/rocket.lua | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mods/ENVIRONMENT/mcl_raids/init.lua b/mods/ENVIRONMENT/mcl_raids/init.lua index b900418f6..fead074ae 100644 --- a/mods/ENVIRONMENT/mcl_raids/init.lua +++ b/mods/ENVIRONMENT/mcl_raids/init.lua @@ -236,8 +236,12 @@ local function get_point_on_circle(pos,r,n) end local function start_firework_rocket(pos) - local pp = get_point_on_circle(pos,math.random(32,64),32) - local o = minetest.add_entity(pp,"mcl_bows:rocket_entity") + local p = get_point_on_circle(pos,math.random(32,64),32) + local n = minetest.get_node(p) + local l = minetest.get_natural_light(pos,0.5) + if n.name ~= "air" or l <= minetest.LIGHT_MAX then return end + local o = minetest.add_entity(p,"mcl_bows:rocket_entity") + o:get_luaentity()._harmless = true o:set_acceleration(vector.new(math.random(0,2),math.random(30,50),math.random(0,2))) end diff --git a/mods/ITEMS/mcl_bows/rocket.lua b/mods/ITEMS/mcl_bows/rocket.lua index 6180472c1..e71c0c122 100644 --- a/mods/ITEMS/mcl_bows/rocket.lua +++ b/mods/ITEMS/mcl_bows/rocket.lua @@ -19,6 +19,7 @@ local function dir_to_pitch(dir) end local function damage_explosion(self, damagemulitplier) + if self._harmless then return end local p = self.object:get_pos() if not p then return end mcl_explosions.explode(p, 3, {})