mirror of
https://bitbucket.org/grumdrig/pq.git
synced 2026-09-29 00:33:59 -06:00
Fix another segfault error. Bump version to 6.4.3
This commit is contained in:
@@ -105,7 +105,7 @@ object FrontForm: TFrontForm
|
||||
Height = 13
|
||||
Align = alBottom
|
||||
Alignment = taCenter
|
||||
Caption = #169' 2002-2022 Eric Fredricksen - v6.4.2'
|
||||
Caption = #169' 2002-2022 Eric Fredricksen - v6.4.3'
|
||||
Color = clWhite
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = 11382189
|
||||
|
||||
@@ -3,7 +3,7 @@ unit Main;
|
||||
|
||||
{$UNDEF CHEATS}
|
||||
{$UNDEF LOGGING}
|
||||
{$UNDEF TURBO}
|
||||
{$DEFINE TURBO}
|
||||
|
||||
interface
|
||||
|
||||
@@ -841,11 +841,17 @@ begin
|
||||
t := 0;
|
||||
for i := 0 to 5 do Inc(t,Square(GetI(Stats,i)));
|
||||
t := Random(t);
|
||||
// High stats cause int overflow
|
||||
if t < 0 then i := Random(Stats.Items.Count)
|
||||
else begin
|
||||
i := -1;
|
||||
while t >= 0 do begin
|
||||
Inc(i);
|
||||
if i >= Stats.Items.Count then begin
|
||||
// This happens with high stats due to integer overflow
|
||||
i := Random(Stats.Items.Count);
|
||||
break;
|
||||
end;
|
||||
Dec(t,Square(GetI(Stats,i)));
|
||||
end;
|
||||
end;
|
||||
|
||||
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user