mirror of
https://codeberg.org/tenplus1/mob_horse.git
synced 2025-01-08 17:00:20 +01:00
fix saddle issue
This commit is contained in:
parent
f0a2a8ac05
commit
dc74b26412
12
init.lua
12
init.lua
@ -75,6 +75,7 @@ mobs:register_mob("mob_horse:horse", {
|
|||||||
if self.driver then
|
if self.driver then
|
||||||
minetest.add_item(pos, "mobs:saddle")
|
minetest.add_item(pos, "mobs:saddle")
|
||||||
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
|
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
|
||||||
|
self.saddle = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
-- drop any horseshoes added
|
-- drop any horseshoes added
|
||||||
@ -118,16 +119,23 @@ mobs:register_mob("mob_horse:horse", {
|
|||||||
minetest.add_item(clicker:get_pos(), "mobs:saddle")
|
minetest.add_item(clicker:get_pos(), "mobs:saddle")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self.saddle = nil
|
||||||
|
|
||||||
-- attach player to horse
|
-- attach player to horse
|
||||||
elseif not self.driver
|
elseif (not self.driver
|
||||||
and clicker:get_wielded_item():get_name() == "mobs:saddle" then
|
and clicker:get_wielded_item():get_name() == "mobs:saddle")
|
||||||
|
or self.saddle then
|
||||||
|
|
||||||
self.object:set_properties({stepheight = 1.1})
|
self.object:set_properties({stepheight = 1.1})
|
||||||
mobs.attach(self, clicker)
|
mobs.attach(self, clicker)
|
||||||
|
|
||||||
-- take saddle from inventory
|
-- take saddle from inventory
|
||||||
|
if not self.saddle then
|
||||||
inv:remove_item("main", "mobs:saddle")
|
inv:remove_item("main", "mobs:saddle")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self.saddle = true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- used to capture horse with magic lasso
|
-- used to capture horse with magic lasso
|
||||||
|
Loading…
Reference in New Issue
Block a user