# HG changeset patch # User unc0rr # Date 1234630468 0 # Node ID 2457fcc0dcd9f9c982b4e0e2499e1418aff0c716 # Parent 8ae48e3b02d941a4574a897565acb62003af9eaa - Set bamboo plinko hedgehogs limit to 48 - Better limit reading code diff -r 8ae48e3b02d9 -r 2457fcc0dcd9 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Sat Feb 14 16:51:10 2009 +0000 +++ b/hedgewars/uGears.pas Sat Feb 14 16:54:28 2009 +0000 @@ -1380,7 +1380,7 @@ // unC0Rr, while it is true user can watch value on map screen, IMO this (and check above) should be enforced in UI // - is there a good place to put values for the different widgets to check? Right now they are kind of disconnected. //it'd be nice if divide teams, forts mode and hh per map could all be checked by the team widget, or maybe disable start button - TryDo(Count <= MaxHedgehogs, 'Too many hedgehogs for this map!', true); + TryDo(Count <= MaxHedgehogs, 'Too many hedgehogs for this map! (max # is ' + inttostr(MaxHedgehogs) + ')', true); while (Count > 0) do begin i:= GetRandom(Count); diff -r 8ae48e3b02d9 -r 2457fcc0dcd9 hedgewars/uLand.pas --- a/hedgewars/uLand.pas Sat Feb 14 16:51:10 2009 +0000 +++ b/hedgewars/uLand.pas Sat Feb 14 16:54:28 2009 +0000 @@ -640,11 +640,8 @@ procedure LoadMap; var tmpsurf: PSDL_Surface; - s: string; - a,b: shortstring; - f: textfile; - tn: Longint; - + s: string; + f: textfile; begin WriteLnToConsole('Loading land from file...'); AddProgress; @@ -656,9 +653,9 @@ WriteLnToConsole('Fetching map HH limit'); Assign(f, s); Reset(f); -Readln(f, a); -SplitBySpace(a,b); -Val(b,MaxHedgehogs,tn); +Readln(f); +if not eof(f) then Readln(f, MaxHedgehogs); + if(MaxHedgehogs = 0) then MaxHedgehogs:= 18; playHeight:= tmpsurf^.h; diff -r 8ae48e3b02d9 -r 2457fcc0dcd9 share/hedgewars/Data/Maps/BambooPlinko/map.cfg --- a/share/hedgewars/Data/Maps/BambooPlinko/map.cfg Sat Feb 14 16:51:10 2009 +0000 +++ b/share/hedgewars/Data/Maps/BambooPlinko/map.cfg Sat Feb 14 16:54:28 2009 +0000 @@ -1,1 +1,2 @@ -Bamboo \ No newline at end of file +Bamboo +48