diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 0f847b22d9..8a583c96e1 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -248,7 +248,7 @@ local set_velocity = function(self, v) end -- halt mob if it has been ordered to stay - if self.order == "stand" then + if self.order == "stand" or self.order == "sit" then self.object:set_velocity({x = 0, y = 0, z = 0}) return end @@ -2392,9 +2392,13 @@ local do_states = function(self, dtime) yaw = set_yaw(self, yaw, 8) end - - set_velocity(self, 0) - set_animation(self, "stand") + if self.order == "sit" then + set_animation(self, "sit") + set_velocity(self, 0) + else + set_animation(self, "stand") + set_velocity(self, 0) + end -- npc's ordered to stand stay standing if self.type ~= "npc" diff --git a/mods/ENTITIES/mobs_mc/models/mobs_mc_wolf.b3d b/mods/ENTITIES/mobs_mc/models/mobs_mc_wolf.b3d index 63db5e0970..28bdb3b49f 100644 Binary files a/mods/ENTITIES/mobs_mc/models/mobs_mc_wolf.b3d and b/mods/ENTITIES/mobs_mc/models/mobs_mc_wolf.b3d differ diff --git a/mods/ENTITIES/mobs_mc/wolf.lua b/mods/ENTITIES/mobs_mc/wolf.lua index 4a7de9ac01..fb9f6bcf7d 100644 --- a/mods/ENTITIES/mobs_mc/wolf.lua +++ b/mods/ENTITIES/mobs_mc/wolf.lua @@ -66,6 +66,9 @@ local wolf = { ent = dog:get_luaentity() ent.owner = clicker:get_player_name() ent.tamed = true + mcl_mobs:set_animation(ent, "sit") + ent.walk_chance = 0 + ent.jump = false -- cornfirm taming minetest.sound_play("mobs_mc_wolf_bark", {object=dog, max_hear_distance=16}, true) -- Replace wolf @@ -75,9 +78,10 @@ local wolf = { end, animation = { speed_normal = 50, speed_run = 100, - stand_start = 40, stand_end = 45, - walk_start = 0, walk_end = 40, - run_start = 0, run_end = 40, + stand_start = 0, stand_end = 40, + walk_start = 40, walk_end = 80, + run_start = 80, run_end = 120, + sit_start = 121, sit_end = 140, }, jump = true, attacks_monsters = true, @@ -128,7 +132,8 @@ dog.hp_max = 20 dog.textures = get_dog_textures("unicolor_red") dog.owner = "" -- TODO: Start sitting by default -dog.order = "roam" +dog.order = "sit" +dog.state = "stand" dog.owner_loyal = true dog.follow_velocity = 3.2 -- Automatically teleport dog to owner @@ -190,14 +195,18 @@ dog.on_rightclick = function(self, clicker) if not self.order or self.order == "" or self.order == "sit" then particle = "mobs_mc_wolf_icon_roam.png" self.order = "roam" + self.state = "stand" self.walk_chance = default_walk_chance self.jump = true + mcl_mobs:set_animation(self, "stand") -- TODO: Add sitting model else particle = "mobs_mc_wolf_icon_sit.png" self.order = "sit" + self.state = "stand" self.walk_chance = 0 self.jump = false + mcl_mobs:set_animation(self, "sit") end -- Display icon to show current order (sit or roam) minetest.add_particle({