forked from VoxeLibre/VoxeLibre
Don't update mob xp when in invulnerable state
This commit is contained in:
parent
bf7d08eb9d
commit
c632b77cdb
|
@ -546,13 +546,13 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
|||
self.health = 0
|
||||
end
|
||||
|
||||
-- set/update 'drop xp' timestamp if hitted by player
|
||||
self.xp_timestamp = time_now
|
||||
|
||||
-- check for invulnerability time in microseconds (0.5 second)
|
||||
if time_now - self.invul_timestamp <= 500000 then
|
||||
return
|
||||
end
|
||||
|
||||
-- set/update 'drop xp' timestamp if hitted by player
|
||||
self.xp_timestamp = time_now
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue