From 384aa7c5adbaec638277e9caf0840dad77540b58 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sun, 19 Jul 2009 17:06:29 +0000 Subject: 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 --- src/base/UParty.pas | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit v1.2.3