# HG changeset patch
# User unc0rr
# Date 1345616846 -14400
# Node ID 22a7bfa3e6bbb1ee89c8b80fa0fdca318fa81295
# Parent  c7d4e035cf9d200046c82f3081db69e877b0aaa5
now really avoid

diff -r c7d4e035cf9d -r 22a7bfa3e6bb hedgewars/uLand.pas
--- a/hedgewars/uLand.pas	Tue Aug 21 21:02:52 2012 -0400
+++ b/hedgewars/uLand.pas	Wed Aug 22 10:27:26 2012 +0400
@@ -285,7 +285,7 @@
         4: SelectTemplate:= CavernTemplates[getrandom(Succ(High(CavernTemplates)))];
         5: SelectTemplate:= WackyTemplates[getrandom(Succ(High(WackyTemplates)))];
 // For lua only!
-        6: SelectTemplate:= min(max(LuaTemplateNumber,0),Succ(High(EdgeTemplates)));
+        6: SelectTemplate:= min(max(LuaTemplateNumber,0),High(EdgeTemplates));
     end;
 
     WriteLnToConsole('Selected template #'+inttostr(SelectTemplate)+' using filter #'+inttostr(cTemplateFilter));