1
0
Fork 0

Increase collision box to fix issues with splash potions not breaking at feet.

This commit is contained in:
bzoss 2020-06-16 08:25:42 -04:00
parent 724ff56bbf
commit 54c1be724d
1 changed files with 6 additions and 4 deletions

View File

@ -22,14 +22,15 @@ local function register_splash(name, descr, color, def)
itemstack:take_item() itemstack:take_item()
return itemstack return itemstack
end, end,
stack_max = 100, -- increased stack to test throwing
}) })
local w = 0.35 local w = 0.7
minetest.register_entity(id.."_flying",{ minetest.register_entity(id.."_flying",{
textures = {splash_image(color)}, textures = {splash_image(color)},
hp_max = 1, hp_max = 1,
visual_size = {x=w,y=w}, visual_size = {x=w/2,y=w/2},
collisionbox = {-w,-w,-w,w,w,w}, collisionbox = {-w,-w,-w,w,w,w},
on_step = function(self, dtime) on_step = function(self, dtime)
local pos = self.object:getpos() local pos = self.object:getpos()
@ -52,12 +53,13 @@ local function register_splash(name, descr, color, def)
maxexptime = 5, maxexptime = 5,
minsize = 2, minsize = 2,
maxsize = 4, maxsize = 4,
collisiondetection = true, collisiondetection = false,
vertical = false, vertical = false,
texture = "mcl_potions_sprite.png^[colorize:"..color..":127", texture = "mcl_potions_sprite.png^[colorize:"..color..":127",
}) })
self.object:remove() self.object:remove()
for i, obj in ipairs(minetest.get_objects_inside_radius(pos, 4)) do for i, obj in ipairs(minetest.get_objects_inside_radius(pos, 4)) do
if minetest.is_player(obj) then if minetest.is_player(obj) then
pos2 = obj:get_pos() pos2 = obj:get_pos()