From e2987245fd6c6ee75383ea92da30e9fc5e10ad1e Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Sat, 17 Apr 2021 17:00:34 -0400 Subject: [PATCH] Balance out collision forces for mobs --- mods/ENTITIES/mcl_mobs/api/mob_functions/animation.lua | 6 ------ mods/ENTITIES/mcl_mobs/api/mob_functions/collision.lua | 7 ++++++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/animation.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/animation.lua index 8d37b7c09..97d0f7894 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/animation.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/animation.lua @@ -9,12 +9,6 @@ local vector_new = vector.new local minetest_dir_to_yaw = minetest.dir_to_yaw - --- simple degrees calculation -local degrees = function(yaw) - return(yaw*180.0/math_pi) -end - -- set defined animation mobs.set_mob_animation = function(self, anim, fixed_frame) diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/collision.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/collision.lua index e6c89e2db..91feeb192 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/collision.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/collision.lua @@ -1,6 +1,7 @@ local minetest_get_objects_inside_radius = minetest.get_objects_inside_radius local math_random = math.random +local vector_multiply = vector.multiply local integer_test = {-1,1} @@ -74,8 +75,12 @@ mobs.collision = function(self) local vel1 = vector.multiply(velocity, -1.5) local vel2 = vector.multiply(velocity, 1.5) - vel1 = vector.multiply(vel1, force) + vel1 = vector.multiply(vel1, force * 10) vel2 = vector.multiply(vel2, force) + + if object:is_player() then + vel2 = vector_multiply(vel2, 2.5) + end self.object:add_velocity(vel1) object:add_velocity(vel2)