diff options
author | k-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2009-07-19 17:06:29 +0000 |
---|---|---|
committer | k-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2009-07-19 17:06:29 +0000 |
commit | 384aa7c5adbaec638277e9caf0840dad77540b58 (patch) | |
tree | 72251ba9b626fdb7bbbd0a69d965640235e8030a /src/base | |
parent | 1ce18fc38205cc21752579b3cb5dd4c083730ba2 (diff) | |
download | usdx-384aa7c5adbaec638277e9caf0840dad77540b58.tar.gz usdx-384aa7c5adbaec638277e9caf0840dad77540b58.tar.xz usdx-384aa7c5adbaec638277e9caf0840dad77540b58.zip |
Do not use range overflow for CurRound. Could probably be done nicer.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1853 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/UParty.pas | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/base/UParty.pas b/src/base/UParty.pas index e29b977c..615418f1 100644 --- a/src/base/UParty.pas +++ b/src/base/UParty.pas @@ -254,8 +254,13 @@ var begin if ((CurRound < high(Rounds)) or (CurRound = high(CurRound))) then begin - //Increase Current Round - Inc(CurRound); + // Increase Current Round but not beyond its limit + // CurRound is set to 255 to begin with! + // Ugly solution if you ask me. + if CurRound < high(CurRound) then + Inc(CurRound) + else + CurRound := 0; Rounds[CurRound].Winner := 255; DllMan.LoadPlugin(Rounds[CurRound].Plugin); |