Fix SetAmmoTexts not working in stats-only mode
authorunc0rr
Sat, 15 Sep 2018 20:56:31 +0200
changeset 13780 fdae1ed9b6db
parent 13778 e2d902745fd5
child 13781 e17b1ba5d75c
Fix SetAmmoTexts not working in stats-only mode
hedgewars/uWorld.pas
--- a/hedgewars/uWorld.pas	Sat Sep 15 16:22:04 2018 +0200
+++ b/hedgewars/uWorld.pas	Sat Sep 15 20:56:31 2018 +0200
@@ -2005,6 +2005,8 @@
     ammoStr: ansistring;
     tmpsurf: PSDL_Surface;
 begin
+    if cOnlyStats then exit;
+    
     ammoStrId := Ammoz[ammoType].NameId;
 
     trluaammo[ammoStrId] := name;
@@ -2014,7 +2016,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);