forked from VoxeLibre/VoxeLibre
Compare commits
4 Commits
master
...
cat_textur
Author | SHA1 | Date |
---|---|---|
|
3091a1fdcb | |
|
5f4a0d837b | |
|
0f77909868 | |
|
20618a5a74 |
|
@ -312,6 +312,8 @@ function mob_class:check_breeding()
|
||||||
end
|
end
|
||||||
|
|
||||||
function mob_class:toggle_sit(clicker,p)
|
function mob_class:toggle_sit(clicker,p)
|
||||||
|
local default_walk_chance = 50 -- was previously undefined.
|
||||||
|
|
||||||
if not self.tamed or self.child or self.owner ~= clicker:get_player_name() then
|
if not self.tamed or self.child or self.owner ~= clicker:get_player_name() then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,6 +9,8 @@ local S = minetest.get_translator("mobs_mc")
|
||||||
--################### OCELOT AND CAT
|
--################### OCELOT AND CAT
|
||||||
--###################
|
--###################
|
||||||
|
|
||||||
|
local OCELOT_DEBUG = true
|
||||||
|
|
||||||
local pr = PseudoRandom(os.time()*12)
|
local pr = PseudoRandom(os.time()*12)
|
||||||
|
|
||||||
local default_walk_chance = 70
|
local default_walk_chance = 70
|
||||||
|
@ -100,6 +102,11 @@ local ocelot = {
|
||||||
ent.owner = clicker:get_player_name()
|
ent.owner = clicker:get_player_name()
|
||||||
ent.tamed = true
|
ent.tamed = true
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
|
|
||||||
|
if self.object ~= nil then
|
||||||
|
minetest.log("error", "Ocelot::Did not remove old entity on tame.")
|
||||||
|
end
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -162,7 +169,14 @@ cat.on_spawn = function(self)
|
||||||
self._texture = {"mobs_mc_cat_black.png"}
|
self._texture = {"mobs_mc_cat_black.png"}
|
||||||
end
|
end
|
||||||
if not self._texture then
|
if not self._texture then
|
||||||
self._texture = cat.textures[math.random(#cat.textures)]
|
local max_tex = #cat.textures
|
||||||
|
if OCELOT_DEBUG then
|
||||||
|
minetest.log (dump(cat.textures))
|
||||||
|
end
|
||||||
|
self._texture = cat.textures[pr:next(1,max_tex)] -- pick a random texture.
|
||||||
|
if OCELOT_DEBUG then
|
||||||
|
minetest.log (dump(self._texture))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
self.object:set_properties({textures = {self._texture}})
|
self.object:set_properties({textures = {self._texture}})
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue