diff options
author | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-04-17 15:50:43 +0000 |
---|---|---|
committer | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-04-17 15:50:43 +0000 |
commit | 4b502e678735fe19ccc7bd140b4ff34ac1406628 (patch) | |
tree | fdb25cd3cf776a1be79502effc973104c5f09c8e /src | |
parent | 65f817b9434cb60468d940bb1c23585e52800ea7 (diff) | |
download | usdx-4b502e678735fe19ccc7bd140b4ff34ac1406628.tar.gz usdx-4b502e678735fe19ccc7bd140b4ff34ac1406628.tar.xz usdx-4b502e678735fe19ccc7bd140b4ff34ac1406628.zip |
some parts recoded more simply, maybe this will fix infinite score raise bug
can't reproduce it anyway :P
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2245 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src')
-rw-r--r-- | src/base/USingScores.pas | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/base/USingScores.pas b/src/base/USingScores.pas index 6fdfaeb6..71389f32 100644 --- a/src/base/USingScores.pas +++ b/src/base/USingScores.pas @@ -571,19 +571,14 @@ function TSingScores.GetPopUpPoints(const Index: integer): integer; begin Result := 0; - // only check points if there is a difference between actual - // and displayed points - if (Players[Index].Score > Players[Index].ScoreDisplayed) then + CurPopUp := FirstPopUp; + while (CurPopUp <> nil) do begin - CurPopUp := FirstPopUp; - while (CurPopUp <> nil) do - begin - if (CurPopUp.Player = Index) then - begin // add points left "in" popup to result - Inc(Result, CurPopUp.ScoreDiff - CurPopUp.ScoreGiven); - end; - CurPopUp := CurPopUp.Next; + if (CurPopUp.Player = Index) then + begin // add points left "in" popup to result + Inc(Result, CurPopUp.ScoreDiff - CurPopUp.ScoreGiven); end; + CurPopUp := CurPopUp.Next; end; end; @@ -754,12 +749,16 @@ begin if (S <> 0) then begin - if (S > 0) then - Diff := Min(Round(RoundTo((RaisePerSecond * TimePassed) / 1000, 1)), S) - else - Diff := Max(Round(RoundTo((RaisePerSecond * TimePassed) / 1000, 1)), S); + Diff := Round(RoundTo((RaisePerSecond * TimePassed) / 1000, 1)); + + { minimal raise per frame = 1 } + if Abs(Diff) < 1 then + Diff := Sign(S); - Inc(aPlayers[Index].ScoreDisplayed, Diff); + if (Abs(Diff) < Abs(S)) then + Inc(aPlayers[Index].ScoreDisplayed, Diff) + else + Inc(aPlayers[Index].ScoreDisplayed, S); end; end; |