Merge pull request 'Two fixes to mobs' (#1622) from jordan4ibanez/MineClone2:mineclone5 into mineclone5
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/1622mineclone5
commit
db0e3a389d
|
@ -85,6 +85,11 @@ end
|
||||||
-- states are executed here
|
-- states are executed here
|
||||||
local land_state_execution = function(self,dtime)
|
local land_state_execution = function(self,dtime)
|
||||||
|
|
||||||
|
--no collisionbox exception
|
||||||
|
if not self.object:get_properties() then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local pos = self.object:get_pos()
|
local pos = self.object:get_pos()
|
||||||
local collisionbox = self.object:get_properties().collisionbox
|
local collisionbox = self.object:get_properties().collisionbox
|
||||||
--get the center of the mob
|
--get the center of the mob
|
||||||
|
@ -739,6 +744,14 @@ mobs.mob_step = function(self, dtime)
|
||||||
self.pause_timer = 0
|
self.pause_timer = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--stop projectile mobs from being completely disabled while stunned
|
||||||
|
if self.projectile_timer and self.projectile_timer > 0.01 then
|
||||||
|
self.projectile_timer = self.projectile_timer - dtime
|
||||||
|
if self.projectile_timer < 0.01 then
|
||||||
|
self.projectile_timer = 0.01
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return -- don't allow collision detection
|
return -- don't allow collision detection
|
||||||
--do normal ai
|
--do normal ai
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue