From 3560bda4a5a8be026c5d50eb8ddeca9ed45e0b8e Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Fri, 23 Apr 2021 17:29:23 -0400 Subject: [PATCH] Remove unused code and variables from mob punch --- .../api/mob_functions/interaction.lua | 35 ++----------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/interaction.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/interaction.lua index 00ad066f07..4a13a3499f 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/interaction.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/interaction.lua @@ -182,7 +182,6 @@ mobs.mob_punch = function(self, hitter, tflp, tool_capabilities, dir) mobs.critical_effect(self) end - local die = false -- only play hit sound and show blood effects if damage is 1 or over; lower to 0.1 to ensure armor works appropriately. if damage >= 0.1 then @@ -223,12 +222,11 @@ mobs.mob_punch = function(self, hitter, tflp, tool_capabilities, dir) multiplier = knockback_enchant + 1 --(starts from 1, 1 would be no change) end + --do this to sure you can punch a mob back when + --it's coming for you if self.hostile then multiplier = multiplier + 2 - end - - - local luaentity + end dir = vector_multiply(dir,multiplier) @@ -240,33 +238,6 @@ mobs.mob_punch = function(self, hitter, tflp, tool_capabilities, dir) --0.4 seconds until you can hurt the mob again self.pause_timer = 0.4 end - -- END if damage - - -- if skittish then run away - --[[ - if not die and self.runaway == true and self.state ~= "flop" then - - local lp = hitter:get_pos() - local s = self.object:get_pos() - local vec = { - x = lp.x - s.x, - y = lp.y - s.y, - z = lp.z - s.z - } - - local yaw = (atan(vec.z / vec.x) + 3 * math_pi / 2) - self.rotate - - if lp.x > s.x then - yaw = yaw + math_pi - end - - yaw = set_yaw(self, yaw, 6) - self.state = "runaway" - self.runaway_timer = 0 - self.following = nil - end - - ]]-- end --do internal per mob projectile calculations