mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-19 01:21:05 +01:00
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:
commit
a344755894
1 changed files with 10 additions and 13 deletions
|
@ -44,18 +44,6 @@ local function get_drops(self)
|
||||||
max = 2,
|
max = 2,
|
||||||
looting = "common",
|
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
|
end
|
||||||
|
|
||||||
-- Helper functions to determine equipment rules
|
-- Helper functions to determine equipment rules
|
||||||
|
@ -245,10 +233,18 @@ local horse = {
|
||||||
|
|
||||||
on_die = function(self, pos)
|
on_die = function(self, pos)
|
||||||
|
|
||||||
-- drop saddle when horse is killed while riding
|
-- drop saddle when horse is killed
|
||||||
if self._saddle then
|
if self._saddle then
|
||||||
minetest.add_item(pos, "mcl_mobitems:saddle")
|
minetest.add_item(pos, "mcl_mobitems:saddle")
|
||||||
end
|
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
|
-- also detach from horse properly
|
||||||
if self.driver then
|
if self.driver then
|
||||||
mcl_mobs.detach(self.driver, {x = 1, y = 0, z = 1})
|
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
|
-- Put on armor and take armor from player's inventory
|
||||||
local armor = minetest.get_item_group(iname, "horse_armor")
|
local armor = minetest.get_item_group(iname, "horse_armor")
|
||||||
self._horse_armor = iname
|
self._horse_armor = iname
|
||||||
|
self._wearing_armor = true
|
||||||
local w = clicker:get_wielded_item()
|
local w = clicker:get_wielded_item()
|
||||||
if not minetest.is_creative_enabled(clicker:get_player_name()) then
|
if not minetest.is_creative_enabled(clicker:get_player_name()) then
|
||||||
w:take_item()
|
w:take_item()
|
||||||
|
|
Loading…
Reference in a new issue