mirror of
https://bitbucket.org/grumdrig/pq.git
synced 2026-09-29 08:44:00 -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
|
Height = 13
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
Alignment = taCenter
|
Alignment = taCenter
|
||||||
Caption = #169' 2002-2022 Eric Fredricksen - v6.4.2'
|
Caption = #169' 2002-2022 Eric Fredricksen - v6.4.3'
|
||||||
Color = clWhite
|
Color = clWhite
|
||||||
Font.Charset = DEFAULT_CHARSET
|
Font.Charset = DEFAULT_CHARSET
|
||||||
Font.Color = 11382189
|
Font.Color = 11382189
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ unit Main;
|
|||||||
|
|
||||||
{$UNDEF CHEATS}
|
{$UNDEF CHEATS}
|
||||||
{$UNDEF LOGGING}
|
{$UNDEF LOGGING}
|
||||||
{$UNDEF TURBO}
|
{$DEFINE TURBO}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
@@ -841,11 +841,17 @@ begin
|
|||||||
t := 0;
|
t := 0;
|
||||||
for i := 0 to 5 do Inc(t,Square(GetI(Stats,i)));
|
for i := 0 to 5 do Inc(t,Square(GetI(Stats,i)));
|
||||||
t := Random(t);
|
t := Random(t);
|
||||||
|
// High stats cause int overflow
|
||||||
if t < 0 then i := Random(Stats.Items.Count)
|
if t < 0 then i := Random(Stats.Items.Count)
|
||||||
else begin
|
else begin
|
||||||
i := -1;
|
i := -1;
|
||||||
while t >= 0 do begin
|
while t >= 0 do begin
|
||||||
Inc(i);
|
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)));
|
Dec(t,Square(GetI(Stats,i)));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user