Fix tipped arrow behavior, remove debug code

This commit is contained in:
teknomunk 2024-11-16 15:38:19 -06:00
parent 352ebb3b32
commit aafd806e89
2 changed files with 1 additions and 13 deletions

View File

@ -81,7 +81,7 @@ function mcl_potions.register_arrow(name, desc, color, def)
mcl_bows.arrow_entity.on_activate(self, staticdata, dtime_s) mcl_bows.arrow_entity.on_activate(self, staticdata, dtime_s)
self._arrow_item = arrow_item self._arrow_item = arrow_item
end end
minetest.register_entity("mcl_potions:"..name.."_arrow_entity", arrow_entity) vl_projectile.register("mcl_potions:"..name.."_arrow_entity", arrow_entity)
if minetest.get_modpath("mcl_bows") then if minetest.get_modpath("mcl_bows") then
minetest.register_craft({ minetest.register_craft({

View File

@ -308,7 +308,6 @@ local function stuck_on_step(self, dtime, entity_def, projectile_def)
if not minetest.is_creative_enabled(player_name) then if not minetest.is_creative_enabled(player_name) then
local arrow_item = self._itemstring or self._arrow_item local arrow_item = self._itemstring or self._arrow_item
if arrow_item and minetest.registered_items[arrow_item] and obj:get_inventory():room_for_item("main", arrow_item) then if arrow_item and minetest.registered_items[arrow_item] and obj:get_inventory():room_for_item("main", arrow_item) then
minetest.log("inventory add: "..dump(arrow_item))
obj:get_inventory():add_item("main", arrow_item) obj:get_inventory():add_item("main", arrow_item)
self._picked_up = true self._picked_up = true
@ -459,17 +458,6 @@ local function handle_entity_collision(self, entity_def, projectile_def, object)
allow_punching = allow_punching(self, entity_def, projectile_def, object) allow_punching = allow_punching(self, entity_def, projectile_def, object)
end end
if DEBUG then
minetest.log("handle_entity_collision("..dump({
self = self,
allow_punching = allow_punching,
entity_def = entity_def,
object = object,
object_id = mcl_util.get_entity_id(object),
luaentity = object:get_luaentity(),
})..")")
end
if not allow_punching then return end if not allow_punching then return end
local object_lua = object:get_luaentity() local object_lua = object:get_luaentity()