hedgewars/uGears.pas
changeset 2568 e654cbfb23ba
parent 2537 aceebf0653f7
child 2597 f777ac80ffef
--- a/hedgewars/uGears.pas	Tue Oct 20 17:55:11 2009 +0000
+++ b/hedgewars/uGears.pas	Tue Oct 20 21:20:47 2009 +0000
@@ -1239,21 +1239,25 @@
 		or (bShowFinger and ((Gear^.State and gstHHDriven) <> 0)) then
 		begin
 		t:= hwRound(Gear^.Y) - cHHRadius - 12 + WorldDy;
-		if (cTagsMask and 1) <> 0 then
+		if (cTagsMasks[cTagsMaskIndex] and htTransparent) <> 0 then
+			glColor4f(1, 1, 1, 0.5);
+		if ((cTagsMasks[cTagsMaskIndex] and htHealth) <> 0) and ((GameFlags and gfInvulnerable) = 0) then
 			begin
 			dec(t, HealthTagTex^.h + 2);
 			DrawCentered(hwRound(Gear^.X) + WorldDx, t, HealthTagTex)
 			end;
-		if (cTagsMask and 2) <> 0 then
+		if (cTagsMasks[cTagsMaskIndex] and htName) <> 0 then
 			begin
 			dec(t, NameTagTex^.h + 2);
 			DrawCentered(hwRound(Gear^.X) + WorldDx, t, NameTagTex)
 			end;
-		if (cTagsMask and 4) <> 0 then
+		if (cTagsMasks[cTagsMaskIndex] and htTeamName) <> 0 then
 			begin
 			dec(t, Team^.NameTagTex^.h + 2);
 			DrawCentered(hwRound(Gear^.X) + WorldDx, t, Team^.NameTagTex)
-			end
+			end;
+		if (cTagsMasks[cTagsMaskIndex] and htTransparent) <> 0 then
+			glColor4f(1, 1, 1, 1)
 		end;
 	if (Gear^.State and gstHHDriven) <> 0 then // Current hedgehog
 		begin
@@ -1864,6 +1868,9 @@
 else
     t:= getrandom(20);
 
+// avoid health crates if all hogs are invulnerable
+if (t < 13) and ((GameFlags and gfInvulnerable) <> 0) then t:= t * 13 div 20 + 7;
+	
 //case getrandom(20) of
 case t of
      0..6: begin