Merge pull request #14 from TheTermos/dev

hotfix
master
TheTermos 2019-12-09 20:18:40 +01:00 committed by GitHub
commit a4e06bfac2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -820,11 +820,11 @@ function mobkit.physics(self)
local snodepos = mobkit.get_node_pos(spos)
local surfnode = mobkit.nodeatpos(spos)
while surfnode and surfnode.drawtype == 'liquid' do
surfnodename = surfnode.name
surface = snodepos.y+0.5
if surface > spos.y+self.height then break end
snodepos.y = snodepos.y+1
surfnode = mobkit.nodeatpos(snodepos)
surfnodename = surfnode.name
end
self.isinliquid = surfnodename
if surface then -- standing in liquid
@ -892,10 +892,6 @@ function mobkit.actfunc(self, staticdata, dtime_s)
end
end
if self.timeout and self.timeout>0 and dtime_s > self.timeout and next(self.memory)==nil then
self.object:remove()
end
if not self.memory then -- this is the initial activation
self.memory = {}
@ -903,6 +899,10 @@ function mobkit.actfunc(self, staticdata, dtime_s)
if #self.textures > 1 then self.texture_no = random(#self.textures) end
end
if self.timeout and self.timeout>0 and dtime_s > self.timeout and next(self.memory)==nil then
self.object:remove()
end
-- apply texture
if self.texture_no then
local props = {}