Fallback to no hat when hat couldn't be loaded
authorunc0rr
Sun, 18 Jan 2009 14:17:10 +0000
changeset 1698 993c42413387
parent 1697 ea3eddd73f2c
child 1699 15ff0435ea50
Fallback to no hat when hat couldn't be loaded
hedgewars/GSHandlers.inc
hedgewars/uStore.pas
--- a/hedgewars/GSHandlers.inc	Sun Jan 18 13:02:38 2009 +0000
+++ b/hedgewars/GSHandlers.inc	Sun Jan 18 14:17:10 2009 +0000
@@ -2003,7 +2003,7 @@
 Gear^.Y:= Gear^.Y + Gear^.dY;
 
 if (GameTicks and $FF) = 0 then
-	if Gear^.Timer < 2500 then
+	if Gear^.Timer < 3500 then
 		AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtEvilTrace, 0, _0, _0, 0)
 	else
 		AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0);
--- a/hedgewars/uStore.pas	Sun Jan 18 13:02:38 2009 +0000
+++ b/hedgewars/uStore.pas	Sun Jan 18 14:17:10 2009 +0000
@@ -159,9 +159,12 @@
 					NameTagTex:= RenderStringTex(Name, Clan^.Color, fnt16);
 					if Hat <> 'NoHat' then
 						begin
-						texsurf:= LoadImage(Pathz[ptHats] + '/' + Hat, false, true, false);
-						HatTex:= Surface2Tex(texsurf);
-						SDL_FreeSurface(texsurf)
+						texsurf:= LoadImage(Pathz[ptHats] + '/' + Hat, false, false, false);
+						if texsurf <> nil then
+							begin
+							HatTex:= Surface2Tex(texsurf);
+							SDL_FreeSurface(texsurf)
+							end
 						end
 					end;
 		end;
@@ -252,7 +255,6 @@
 		end;
 AddProgress;
 
-AddProgress;
 WriteNames(fnt16);
 MakeCrossHairs;
 LoadGraves;