From 83b5d569ea6e7d1199f0032664e71cc2a46c2796 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 29 Jun 2017 17:38:27 +0200 Subject: [PATCH] Allow to ride llamas without saddle --- llama.lua | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/llama.lua b/llama.lua index 2b2cd77..06517f2 100644 --- a/llama.lua +++ b/llama.lua @@ -88,10 +88,8 @@ mobs:register_mob("mobs_mc:llama", { on_die = function(self, pos) - -- drop saddle when horse is killed while riding - -- also detach from horse properly + -- detach from llama properly if self.driver then - minetest.add_item(pos, mobs_mc.items.saddle) mobs.detach(self.driver, {x = 1, y = 0, z = 1}) end @@ -119,22 +117,11 @@ mobs:register_mob("mobs_mc:llama", { mobs.detach(clicker, {x = 1, y = 0, z = 1}) - -- add saddle back to inventory - if inv:room_for_item("main", mobs_mc.items.saddle) then - inv:add_item("main", mobs_mc.items.saddle) - else - minetest.add_item(clicker.getpos(), mobs_mc.items.saddle) - end - - -- attach player to horse - elseif not self.driver - and clicker:get_wielded_item():get_name() == mobs_mc.items.saddle then + -- attach player to llama + elseif not self.driver then self.object:set_properties({stepheight = 1.1}) mobs.attach(self, clicker) - - -- take saddle from inventory - inv:remove_item("main", mobs_mc.items.saddle) end end