mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-18 13:16:03 +00:00
#SCORING nil check added
This commit is contained in:
@@ -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,17 +1374,18 @@ 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() .. "'." ..
|
||||||
"Player '" .. PlayerName .. "' receives an extra " .. Score .. " points! " .. "Total: " .. Player.Score - Player.Penalty,
|
"Player '" .. PlayerName .. "' receives an extra " .. Score .. " points! " .. "Total: " .. Player.Score - Player.Penalty,
|
||||||
MESSAGE.Type.Information )
|
MESSAGE.Type.Information )
|
||||||
:ToAllIf( self:IfMessagesZone() and self:IfMessagesToAll() )
|
:ToAllIf( self:IfMessagesZone() and self:IfMessagesToAll() )
|
||||||
:ToCoalitionIf( InitCoalition, self:IfMessagesZone() and self:IfMessagesToCoalition() )
|
:ToCoalitionIf( InitCoalition, self:IfMessagesZone() and self:IfMessagesToCoalition() )
|
||||||
|
|
||||||
self:ScoreCSV( PlayerName, "", "HIT_SCORE", 1, Score, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, "", "Zone", TargetUnitType )
|
self:ScoreCSV( PlayerName, "", "HIT_SCORE", 1, Score, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, "", "Zone", TargetUnitType )
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user