forked from mtcontrib/mobs_redo
compatibility with older simple_mobs textures
This commit is contained in:
parent
40e6eaf98a
commit
fb850b0233
12
api.lua
12
api.lua
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
-- Mobs Api (1st February 2017)
|
-- Mobs Api (2nd February 2017)
|
||||||
|
|
||||||
mobs = {}
|
mobs = {}
|
||||||
mobs.mod = "redo"
|
mobs.mod = "redo"
|
||||||
|
@ -1970,7 +1970,7 @@ local falling = function(self, pos)
|
||||||
if self.fall_damage == 1
|
if self.fall_damage == 1
|
||||||
and self.object:getvelocity().y == 0 then
|
and self.object:getvelocity().y == 0 then
|
||||||
|
|
||||||
local d = self.old_y - self.object:getpos().y
|
local d = (self.old_y or 0) - self.object:getpos().y -- remove or 0
|
||||||
|
|
||||||
if d > 5 then
|
if d > 5 then
|
||||||
|
|
||||||
|
@ -2217,12 +2217,12 @@ local mob_activate = function(self, staticdata, dtime_s, def)
|
||||||
-- select random texture, set model and size
|
-- select random texture, set model and size
|
||||||
if not self.base_texture then
|
if not self.base_texture then
|
||||||
|
|
||||||
if #def.textures == 1 then
|
-- compatiblity with old simple mobs textures
|
||||||
self.base_texture = def.textures
|
if type(def.textures[1]) == "string" then
|
||||||
else
|
def.textures = {def.textures}
|
||||||
self.base_texture = def.textures[random(1, #def.textures)]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self.base_texture = def.textures[random(1, #def.textures)]
|
||||||
self.base_mesh = def.mesh
|
self.base_mesh = def.mesh
|
||||||
self.base_size = self.visual_size
|
self.base_size = self.visual_size
|
||||||
self.base_colbox = self.collisionbox
|
self.base_colbox = self.collisionbox
|
||||||
|
|
Loading…
Reference in New Issue
Block a user