forked from VoxeLibre/VoxeLibre
Merge pull request 'Two fixes to mobs' (#1622) from jordan4ibanez/MineClone2:mineclone5 into mineclone5
Reviewed-on: MineClone2/MineClone2#1622
This commit is contained in:
commit
db0e3a389d
|
@ -85,6 +85,11 @@ end
|
|||
-- states are executed here
|
||||
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 collisionbox = self.object:get_properties().collisionbox
|
||||
--get the center of the mob
|
||||
|
@ -739,6 +744,14 @@ mobs.mob_step = function(self, dtime)
|
|||
self.pause_timer = 0
|
||||
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
|
||||
--do normal ai
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue