Merge pull request 'horse: drops: remove 2nd saddle, add armor' (#4047) from Bakawun/MineClone2:horse into master

Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/4047
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
This commit is contained in:
the-real-herowl 2023-12-07 01:02:38 +00:00
commit a344755894

View File

@ -44,18 +44,6 @@ local function get_drops(self)
max = 2,
looting = "common",
})
if self._saddle then
table.insert(self.drops,{name = "mcl_mobitems:saddle",
chance = 1,
min = 1,
max = 1,})
end
if self._chest then
table.insert(self.drops,{name = "mcl_chests:chest",
chance = 1,
min = 1,
max = 1,})
end
end
-- Helper functions to determine equipment rules
@ -245,10 +233,18 @@ local horse = {
on_die = function(self, pos)
-- drop saddle when horse is killed while riding
-- drop saddle when horse is killed
if self._saddle then
minetest.add_item(pos, "mcl_mobitems:saddle")
end
-- drop chest when mule/donkey is killed
if self._chest then
minetest.add_item(pos, "mcl_chests:chest")
end
-- drop armor when horse is killed
if self._wearing_armor then
minetest.add_item(pos, self._horse_armor)
end
-- also detach from horse properly
if self.driver then
mcl_mobs.detach(self.driver, {x = 1, y = 0, z = 1})
@ -401,6 +397,7 @@ local horse = {
-- Put on armor and take armor from player's inventory
local armor = minetest.get_item_group(iname, "horse_armor")
self._horse_armor = iname
self._wearing_armor = true
local w = clicker:get_wielded_item()
if not minetest.is_creative_enabled(clicker:get_player_name()) then
w:take_item()