fix nil error message in dcs.log

When instant killing a target in a capture zone nil error message is printed in the dcs.log. This fixes this issue.
This commit is contained in:
MrAlien753 2023-02-03 22:14:14 +01:00 committed by GitHub
parent f9aa392c6d
commit 6ff433ed7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -715,7 +715,7 @@ do -- ZONE_CAPTURE_COALITION
local UnitHit = EventData.TgtUnit
if UnitHit.ClassName ~= "SCENERY" then
if UnitHit and UnitHit.ClassName ~= "SCENERY" then
-- Check if unit is inside the capture zone and that it is of the defending coalition.
if UnitHit and UnitHit:IsInZone(self) and UnitHit:GetCoalition()==self.Coalition then