Making sure we have a unitId before query UnitHealth on death log

This commit is contained in:
Tercio Jose
2022-05-08 11:10:26 -03:00
parent 81b6edddd8
commit ea25cda43d
+5 -1
View File
@@ -2241,7 +2241,11 @@
if (not unitId) then
unitId = Details:GuessArenaEnemyUnitId(alvo_name)
end
this_event [5] = _UnitHealth(unitId)
if (unitId) then
this_event [5] = _UnitHealth(unitId)
else
this_event [5] = 0
end
else
this_event [5] = _UnitHealth(alvo_name)
end