- Small formatting changes
authorunc0rr
Sat, 12 Apr 2008 17:00:06 +0000
changeset 836 150c7c87e66c
parent 835 6f567934cc44
child 837 05e910ef2bf8
- Small formatting changes - Don't show picked weapon name if the hedgehog is bot or not driven locally
hedgewars/HHHandlers.inc
hedgewars/uMisc.pas
--- a/hedgewars/HHHandlers.inc	Sat Apr 12 16:34:48 2008 +0000
+++ b/hedgewars/HHHandlers.inc	Sat Apr 12 17:00:06 2008 +0000
@@ -74,8 +74,8 @@
      begin
      if ((State and gstHHDriven) <> 0)and
         ((State and (gstAttacked or gstHHChooseTarget)) = 0)and
-        (((State and gstMoving) = 0)or((Ammo^[CurSlot, CurAmmo].Propz and ammoprop_AttackInMove) <> 0))and
-          ((TargetPoint.X <> NoPointX) or ((Ammo^[CurSlot, CurAmmo].Propz and ammoprop_NeedTarget) = 0)) then
+        (((State and gstMoving) = 0) or ((Ammo^[CurSlot, CurAmmo].Propz and ammoprop_AttackInMove) <> 0))and
+        ((TargetPoint.X <> NoPointX) or ((Ammo^[CurSlot, CurAmmo].Propz and ammoprop_NeedTarget) = 0)) then
         begin
         State:= State or gstAttacking;
         if Power = cMaxPower then Message:= Message and not gm_Attack
@@ -170,8 +170,12 @@
        posCaseAmmo: begin
                     a:= TAmmoType(Gear^.State);
                     AddAmmo(PHedgehog(HH^.Hedgehog)^, a);
-                    s:= trammo[Ammoz[a].NameId] + '(+' + IntToStr(Ammoz[a].NumberInCase) + ')';
-                    AddCaption(s, PHedgehog(HH^.Hedgehog)^.Team^.Clan^.Color, capgrpAmmoinfo);
+                    if not (PHedgehog(HH^.Hedgehog)^.Team^.ExtDriven
+                      or (PHedgehog(HH^.Hedgehog)^.BotLevel > 0)) then
+                       begin
+                       s:= trammo[Ammoz[a].NameId] + '(+' + IntToStr(Ammoz[a].NumberInCase) + ')';
+                       AddCaption(s, PHedgehog(HH^.Hedgehog)^.Team^.Clan^.Color, capgrpAmmoinfo);
+                       end
                     end;
      posCaseHealth: begin
                     inc(HH^.Health, Gear^.Health);
@@ -407,21 +411,20 @@
    exit
    end;
 
-if ((Gear^.State and gstMoving) <> 0) then
-	begin
-	if (StepTicks = cHHStepTicks)
+if ((Gear^.State and gstMoving) <> 0)
+    or (StepTicks = cHHStepTicks)
 	or (CurAmmoGear <> nil) then // we're moving
-		begin
-		// check for case with ammo
-		t:= CheckGearNear(Gear, gtCase, 36, 36);
-		if t <> nil then
-			PickUp(Gear, t)
-		end else
+	begin
+	// check for case with ammo
+	t:= CheckGearNear(Gear, gtCase, 36, 36);
+	if t <> nil then
+		PickUp(Gear, t)
+	end else
+	if ((Gear^.State and gstMoving) <> 0) then
 		with PHedgehog(Gear^.Hedgehog)^ do
 			if (CurAmmoGear = nil)
 			and (Gear^.dY > _0_39)
-			and (Ammo^[CurSlot, CurAmmo].AmmoType = amParachute) then Gear^.Message:= Gear^.Message or gm_Attack
-	end;
+			and (Ammo^[CurSlot, CurAmmo].AmmoType = amParachute) then Gear^.Message:= Gear^.Message or gm_Attack;
 
 if CurAmmoGear <> nil then
    begin
--- a/hedgewars/uMisc.pas	Sat Apr 12 16:34:48 2008 +0000
+++ b/hedgewars/uMisc.pas	Sat Apr 12 17:00:06 2008 +0000
@@ -91,7 +91,7 @@
     InitStepsFlags: Longword = 0;
 
     RealTicks: Longword = 0;
-    
+
     AttackBar: LongInt = 0; // 0 - none, 1 - just bar at the right-down corner, 2 - like in WWP
 
 function hwSign(r: hwFloat): LongInt;