Silence useless warning
authorunc0rr
Wed, 20 May 2009 16:35:27 +0000
changeset 2079 f188ec7c450b
parent 2078 2c7353ca43c9
child 2080 6d29370dc0dd
Silence useless warning
hedgewars/CCHandlers.inc
hedgewars/uGears.pas
--- a/hedgewars/CCHandlers.inc	Tue May 19 22:48:27 2009 +0000
+++ b/hedgewars/CCHandlers.inc	Wed May 20 16:35:27 2009 +0000
@@ -282,7 +282,7 @@
 bShowFinger:= false;
 with CurrentHedgehog^.Gear^ do
      begin
-     {$IFDEF DEBUGFILE}AddFileLog('/+attack: Gear^.State = '+inttostr(State));{$ENDIF}
+     {$IFDEF DEBUGFILE}AddFileLog('/+attack: hedgehog''s Gear^.State = '+inttostr(State));{$ENDIF}
      if ((State and gstHHDriven) <> 0) then
         begin
         FollowGear:= CurrentHedgehog^.Gear;
--- a/hedgewars/uGears.pas	Tue May 19 22:48:27 2009 +0000
+++ b/hedgewars/uGears.pas	Wed May 20 16:35:27 2009 +0000
@@ -404,7 +404,7 @@
 	end;
 
 if Gear^.Kind = gtHedgehog then
-	if CurAmmoGear <> nil then
+	if (CurAmmoGear <> nil) and (CurrentHedgehog^.Gear = Gear) then
 		begin
 		Gear^.Message:= gm_Destroy;
 		CurAmmoGear^.Message:= gm_Destroy;