#SCORING nil check added

This commit is contained in:
Applevangelist
2025-11-28 10:19:46 +01:00
parent edb42bbbe9
commit fb3ca6d9d5
@@ -1153,7 +1153,7 @@ function SCORING:_EventOnHit( Event )
TargetType = "Scenery" TargetType = "Scenery"
TargetSceneryObject = TargetUNIT TargetSceneryObject = TargetUNIT
self:T("***** Target is Scenery and TargetUNIT is SCENERY object!") self:T("***** Target is Scenery and TargetUNIT is SCENERY object!")
UTILS.PrintTableToLog(TargetSceneryObject) --UTILS.PrintTableToLog(TargetSceneryObject)
end end
TargetUnitCoalition = _SCORINGCoalition[TargetCoalition] TargetUnitCoalition = _SCORINGCoalition[TargetCoalition]
@@ -1374,7 +1374,7 @@ function SCORING:_EventOnHit( Event )
-- Player contains the score data from self.Players[WeaponPlayerName] -- Player contains the score data from self.Players[WeaponPlayerName]
local PlayerName = Event.IniPlayerName or "Ghost" local PlayerName = Event.IniPlayerName or "Ghost"
local Player = self.Players[PlayerName] local Player = self.Players[PlayerName]
if Player then
Player.Score = Player.Score + Score Player.Score = Player.Score + Score
Player.Score = Player.Score + self.ScoreIncrementOnHit Player.Score = Player.Score + self.ScoreIncrementOnHit
MESSAGE:NewType( self.DisplayMessagePrefix .. "hit in zone '" .. ScoreZone:GetName() .. "'." .. MESSAGE:NewType( self.DisplayMessagePrefix .. "hit in zone '" .. ScoreZone:GetName() .. "'." ..
@@ -1387,6 +1387,7 @@ function SCORING:_EventOnHit( Event )
end end
end end
end end
end
end end