From bce5306abea765fed1fdfeb775ed3abd21ff2863 Mon Sep 17 00:00:00 2001
From: SmallJoker <mk939@ymail.com>
Date: Sun, 19 Jun 2022 16:50:20 +0200
Subject: [PATCH] Fix Mining Drill Mk1 not drilling

---
 technic/radiation.lua |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/technic/radiation.lua b/technic/radiation.lua
index 722b0ac..7092b69 100644
--- a/technic/radiation.lua
+++ b/technic/radiation.lua
@@ -54,6 +54,7 @@
 	["default:lava_source"] = 17,
 	["default:mese"] = 21,
 	["default:mossycobble"] = 15,
+	["default:tinblock"] = 37,
 	["pbj_pup:pbj_pup"] = 10000,
 	["pbj_pup:pbj_pup_candies"] = 10000,
 	["gloopblocks:rainbow_block_diagonal"] = 5000,
@@ -76,6 +77,7 @@
 	["default:stone_with_gold"] = 34,
 	["default:stone_with_iron"] = 20,
 	["default:stone_with_mese"] = 17,
+	["default:stone_with_tin"] = 19,
 	["default:stonebrick"] = 17,
 	["default:water_flowing"] = 2.8,
 	["default:water_source"] = 5.6,
@@ -141,12 +143,10 @@
 	["moreblocks:wood_tile_up"] = 1.7,
 	["moreores:mineral_mithril"] = 18,
 	["moreores:mineral_silver"] = 21,
-	["moreores:mineral_tin"] = 19,
 	["moreores:mithril_block"] = 26,
 	["moreores:silver_block"] = 53,
-	["moreores:tin_block"] = 37,
 	["snow:snow_brick"] = 2.8,
-	["technic:brass_block"] = 43,
+	["basic_materials:brass_block"] = 43,
 	["technic:carbon_steel_block"] = 40,
 	["technic:cast_iron_block"] = 40,
 	["technic:chernobylite_block"] = 40,
@@ -244,7 +244,6 @@
 need to be considered.
 --]]
 local abdomen_offset = 1
-local cache_scaled_shielding = {}
 local rad_dmg_cutoff = 0.2
 local radiated_players = {}
 
@@ -294,6 +293,8 @@
 	end
 	if ag.radiation then
 		return 0.01 * ag.radiation
+	elseif armor_enabled then
+		return 0
 	end
 	if ag.fleshy then
 		return math.sqrt(0.01 * ag.fleshy)
@@ -309,7 +310,7 @@
 end
 
 local function dmg_object(pos, object, strength)
-	local obj_pos = vector.add(object:getpos(), calculate_object_center(object))
+	local obj_pos = vector.add(object:get_pos(), calculate_object_center(object))
 	local mul
 	if armor_enabled or entity_damage then
 		-- we need to check may the object be damaged even if armor is disabled
@@ -338,7 +339,7 @@
 	local max_dist = strength * rad_dmg_mult_sqrt
 	for _, o in pairs(minetest.get_objects_inside_radius(pos,
 			max_dist + abdomen_offset)) do
-		if entity_damage or o:is_player() then
+		if (entity_damage or o:is_player()) and o:get_hp() > 0 then
 			dmg_object(pos, o, strength)
 		end
 	end
@@ -427,7 +428,7 @@
 		liquidtype = state,
 		liquid_alternative_flowing = "technic:corium_flowing",
 		liquid_alternative_source = "technic:corium_source",
-		liquid_viscosity = LAVA_VISC,
+		liquid_viscosity = 7, -- like lava
 		liquid_renewable = false,
 		damage_per_second = 6,
 		post_effect_color = {a=192, r=80, g=160, b=80},
@@ -513,4 +514,3 @@
 		end,
 	})
 end
-

--
Gitblit v1.8.0