diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2018-09-24 18:20:36 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2018-09-24 18:20:36 +0100 |
commit | dc74b26412a0423c9d9b7d62497da669058a9b6d (patch) | |
tree | 264b84e357ad9f8390794e86e32596e2e5ebfd7e | |
parent | f0a2a8ac0596cbf8e56b45c31d3344e145ffeeed (diff) | |
download | mob_horse-dc74b26412a0423c9d9b7d62497da669058a9b6d.tar.gz mob_horse-dc74b26412a0423c9d9b7d62497da669058a9b6d.tar.bz2 mob_horse-dc74b26412a0423c9d9b7d62497da669058a9b6d.zip |
fix saddle issue
-rw-r--r-- | init.lua | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -75,6 +75,7 @@ mobs:register_mob("mob_horse:horse", { if self.driver then minetest.add_item(pos, "mobs:saddle") mobs.detach(self.driver, {x = 1, y = 0, z = 1}) +self.saddle = nil end -- drop any horseshoes added @@ -118,15 +119,22 @@ mobs:register_mob("mob_horse:horse", { minetest.add_item(clicker:get_pos(), "mobs:saddle") end +self.saddle = nil + -- attach player to horse - elseif not self.driver - and clicker:get_wielded_item():get_name() == "mobs:saddle" then + elseif (not self.driver + and clicker:get_wielded_item():get_name() == "mobs:saddle") + or self.saddle then self.object:set_properties({stepheight = 1.1}) mobs.attach(self, clicker) -- take saddle from inventory - inv:remove_item("main", "mobs:saddle") + if not self.saddle then + inv:remove_item("main", "mobs:saddle") + end + +self.saddle = true end end |