1
0
Fork 0

Don't update mob xp when in invulnerable state

This commit is contained in:
Eliy21 2023-11-14 16:44:37 +00:00
parent bf7d08eb9d
commit c632b77cdb
1 changed files with 3 additions and 3 deletions

View File

@ -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