# HG changeset patch
# User unc0rr
# Date 1239627588 0
# Node ID 129e8c4fe5544c688e20259e21b30a7671d47e86
# Parent  03450575ad0f8256dfe3aa87a1a6c661044bf864
 - Fix training
 - Workaround 'Text has zero width' crash

diff -r 03450575ad0f -r 129e8c4fe554 hedgewars/uStore.pas
--- a/hedgewars/uStore.pas	Mon Apr 13 12:53:52 2009 +0000
+++ b/hedgewars/uStore.pas	Mon Apr 13 12:59:48 2009 +0000
@@ -18,7 +18,7 @@
 
 unit uStore;
 interface
-uses uConsts, uTeams, SDLh, 
+uses uConsts, uTeams, SDLh,
 {$IFDEF IPHONE}
 	gles11,
 {$ELSE}
@@ -655,6 +655,7 @@
 var w, h: LongInt;
     Result: PSDL_Surface;
 begin
+if length(s) = 0 then s:= ' ';
 TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(s), w, h);
 
 Result:= SDL_CreateRGBSurface(SDL_SWSURFACE, w + FontBorder * 2 + 4, h + FontBorder * 2,
diff -r 03450575ad0f -r 129e8c4fe554 share/hedgewars/Data/Trainings/001_Shotgun.txt
--- a/share/hedgewars/Data/Trainings/001_Shotgun.txt	Mon Apr 13 12:53:52 2009 +0000
+++ b/share/hedgewars/Data/Trainings/001_Shotgun.txt	Mon Apr 13 12:59:48 2009 +0000
@@ -6,7 +6,7 @@
 $delay 0
 map mushrooms
 theme nature
-ammstore 0000900000000000000000000000000
+ammstore 000090000000000000000000000000000000
 hhcoords 1310 230
 addtrig s2147483649 1 1 31 1150 300 1
 addtrig s1 1 1 31 1310 890 2