use winner state & possible bug fix
This commit is contained in:
parent
cfc4ba44f7
commit
f06144e6d3
@ -152,7 +152,7 @@ hook.Add("PostEndRound", "pointsave_givedapoints", function(winner)
|
||||
--print("GAINED: "..gainedPoints)
|
||||
if gainedPoints < 0 or not ply.PointSaving_StartPoints then gainedPoints = 0 end
|
||||
-- Calculate points to give for each player (Depending on if the round was lost or won)
|
||||
if ply:Team() == TEAM_HUMAN then
|
||||
if ply:Team() == TEAM_HUMAN and winner == TEAM_HUMAN then
|
||||
points = math.Round(ply:GetPoints())
|
||||
pointsToGivePly = math.Round(pointsToGive + jackpot)
|
||||
else
|
||||
@ -163,6 +163,7 @@ hook.Add("PostEndRound", "pointsave_givedapoints", function(winner)
|
||||
-- Set points
|
||||
ply:SetPoints(points + pointsToGivePly)
|
||||
ply:SetSavedPoints(points + pointsToGivePly)
|
||||
ply.PointSaving_StartPoints = nil
|
||||
-- Display message
|
||||
if pointsToGivePly > 0 then
|
||||
ply:PrintMessage(HUD_PRINTTALK, "In the end, you gained additional "..(pointsToGivePly).." points!")
|
||||
|
Loading…
Reference in New Issue
Block a user