diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas
index f021de31011bce9e4b0ad6e4a79123d234e89a4b..ff6757f659ffcb5a4484f2d45588370a6591fcb1 100644 (file)
--- a/src/game/g_menu.pas
+++ b/src/game/g_menu.pas
if list <> nil then
begin
Items := list;
- ItemIndex := Length(list)
+ ItemIndex := -1; (* nothing selected *)
end
else
begin
TempResScale := Round(r_pixel_scale - 1);
with TGUISwitch(menu.GetControl('swResFactor')) do
- ItemIndex := Min(TempResScale, gRC_Width div 640 - 1);
+ ItemIndex := Max(Min(TempResScale, gRC_Width div 640 - 1), 0);
end;
procedure ProcApplyVideoOptions();