Fix SetAmmoTexts not working in stats-only mode 0.9.24
authorunc0rr
Sat, 15 Sep 2018 20:42:02 +0200
branch0.9.24
changeset 13779 c384117f90eb
parent 13690 09757d5aead3
Fix SetAmmoTexts not working in stats-only mode
hedgewars/uWorld.pas
--- a/hedgewars/uWorld.pas	Wed Aug 22 16:47:09 2018 +0200
+++ b/hedgewars/uWorld.pas	Sat Sep 15 20:42:02 2018 +0200
@@ -1978,6 +1978,8 @@
     ammoStr: ansistring;
     tmpsurf: PSDL_Surface;
 begin
+    if cOnlyStats then exit;
+    
     ammoStrId := Ammoz[ammoType].NameId;
 
     trluaammo[ammoStrId] := name;
@@ -1987,7 +1989,7 @@
         ammoStr:= trammo[ammoStrId];
 
     if checkFails(length(ammoStr) > 0,'No default text/translation found for ammo type #' + intToStr(ord(ammoType)) + '!',true) then exit;
-        
+
     tmpsurf:= TTF_RenderUTF8_Blended(Fontz[CheckCJKFont(ammoStr,fnt16)].Handle, PChar(ammoStr), cWhiteColorChannels);
     if checkFails(tmpsurf <> nil,'Name-texture creation for ammo type #' + intToStr(ord(ammoType)) + ' failed!',true) then exit;
     tmpsurf:= doSurfaceConversion(tmpsurf);