Fix in 0.9.9 branch too 0.9.9 0.9.9.2-release
authorunc0rr
Mon, 19 Jan 2009 19:04:44 +0000
branch0.9.9
changeset 1730 8c3e71880f49
parent 1728 fee68e3a3039
child 1734 ee7059418043
Fix in 0.9.9 branch too
hedgewars/uVisualGears.pas
--- a/hedgewars/uVisualGears.pas	Mon Jan 19 18:53:04 2009 +0000
+++ b/hedgewars/uVisualGears.pas	Mon Jan 19 19:04:44 2009 +0000
@@ -56,13 +56,18 @@
 
 procedure AddDamageTag(X, Y, Damage, Color: LongWord);
 var s: shortstring;
+	Gear: PVisualGear;
 begin
 if cAltDamage then
-	with AddVisualGear(X, Y, vgtSmallDamageTag)^ do
-		begin
-		str(Damage, s);
-		Tex:= RenderStringTex(s, Color, fntSmall);
-		end;
+	begin
+	Gear:= AddVisualGear(X, Y, vgtSmallDamageTag);
+	if Gear <> nil then
+		with Gear^ do
+			begin
+			str(Damage, s);
+			Tex:= RenderStringTex(s, Color, fntSmall);
+			end
+	end
 end;