hedgewars/HHHandlers.inc
changeset 3428 46a2694867bc
parent 3422 41ae3c48faa0
child 3430 21c08c95a672
--- a/hedgewars/HHHandlers.inc	Wed May 05 22:03:10 2010 +0000
+++ b/hedgewars/HHHandlers.inc	Thu May 06 01:41:07 2010 +0000
@@ -102,7 +102,6 @@
 procedure Attack(Gear: PGear);
 var xx, yy: hwFloat;
     tmpGear: PVisualGear;
-    newGear, iterator, portal: PGear;
 begin
 bShowFinger:= false;
 with Gear^,
@@ -158,46 +157,7 @@
                          amMine: AddGear(hwRound(X) + hwSign(dX) * 7, hwRound(Y), gtMine, gstWait, SignAs(_0_02, dX), _0, 3000);
                        amDEagle: CurAmmoGear:= AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtDEagleShot, 0, xx * _0_5, yy * _0_5, 0);
                       amSineGun: CurAmmoGear:= AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtSineGunShot, 0, xx * _0_5, yy * _0_5, 0);
-                    amPortalGun: begin
-                                 iterator:= GearsList;
-                                 portal:= nil;
-                                 while iterator <> nil do
-                                     begin
-                                     if (iterator^.Kind = gtPortal) then
-                                         begin
-                                         newGear:= iterator;
-                                         iterator:= iterator^.NextGear;
-                                         if (portal <> nil) then
-                                             begin
-                                             if (portal^.uid < newGear^.uid) then 
-                                                 begin
-                                                 deleteGear(portal);
-                                                 portal:= newGear
-                                                 end
-                                             else
-                                                 begin
-                                                 if newGear^.NextGear = nil then iterator:= nil;
-                                                 deleteGear(newGear);
-                                                 end
-                                             end
-                                         else portal:= newGear
-                                         end
-                                     else iterator:= iterator^.NextGear
-                                     end;
-
-                                 newGear:= AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtPortal, 0, xx * _0_6, yy * _0_6, 0);
-                                 if portal <> nil then 
-                                     begin
-                                     newGear^.IntersectGear:= portal;
-                                     if portal^.Tag < 2 then newGear^.Tag:= 2
-                                     end
-                                 else newGear^.IntersectGear:= nil;
-                                 newGear^.Angle:= Angle;
-                                 newGear^.DirAngle:= Angle * 180 / cMaxAngle - 90;
-                                 if Gear^.DirAngle < 0 then Gear^.DirAngle:= Gear^.DirAngle + 360
-                                 else if 360 < Gear^.DirAngle then Gear^.DirAngle:= Gear^.DirAngle - 360;
-                                 Ammo^[CurSlot, CurAmmo].Timer:= 0
-                                 end;
+                    amPortalGun: AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtPortal, 0, xx * _0_6, yy * _0_6, 0);
                   amSniperRifle: begin
                                  PlaySound(sndSniperReload);
                                  CurAmmoGear:= AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtSniperRifleShot, 0, xx * _0_5, yy * _0_5, 0);