preventing a racing condition

master
Alexsandro Percy 2022-05-05 18:27:06 -03:00
parent 90f84a7a2e
commit 77a841bda7
1 changed files with 3 additions and 1 deletions

View File

@ -264,7 +264,9 @@ function pa28.testImpact(self, velocity, position)
local impact = abs(pa28.get_hipotenuse_value(velocity, self._last_vel))
--minetest.chat_send_all('impact: '.. impact .. ' - hp: ' .. self.hp_max)
if impact > 2 then
collision = self.colinfo.collides
if self.colinfo then
collision = self.colinfo.collides
end
end
if impact > 1.2 and self._longit_speed > 3 then