hedgewars/uGearsHandlersMess.pas
changeset 15229 b96868956514
parent 15228 1dd99fc2a0e8
child 15230 4576e41c0692
equal deleted inserted replaced
15228:1dd99fc2a0e8 15229:b96868956514
  3093             3: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtDrill, gsttmpFlag, cBombsSpeed * Gear^.Tag, _0, Gear^.Timer + 1);
  3093             3: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtDrill, gsttmpFlag, cBombsSpeed * Gear^.Tag, _0, Gear^.Timer + 1);
  3094         end;
  3094         end;
  3095         Gear^.dX := Gear^.dX + int2hwFloat(Gear^.Damage * Gear^.Tag);
  3095         Gear^.dX := Gear^.dX + int2hwFloat(Gear^.Damage * Gear^.Tag);
  3096         if CheckCoordInWater(hwRound(Gear^.X), hwRound(Gear^.Y)) then
  3096         if CheckCoordInWater(hwRound(Gear^.X), hwRound(Gear^.Y)) then
  3097             FollowGear^.State:= FollowGear^.State or gstSubmersible;
  3097             FollowGear^.State:= FollowGear^.State or gstSubmersible;
  3098         StopSoundChan(Gear^.SoundChannel, 4000);
  3098         if (Gear^.SoundChannel <> -1) then
  3099         end;
  3099             begin
  3100 
  3100             StopSoundChan(Gear^.SoundChannel, 4000);
       
  3101             Gear^.SoundChannel := -1;
       
  3102             end;
       
  3103         end;
       
  3104 
       
  3105     // Particles
  3101     if (GameTicks and $3F) = 0 then
  3106     if (GameTicks and $3F) = 0 then
  3102         if CheckCoordInWater(hwRound(Gear^.X), hwRound(Gear^.Y)) then
  3107         if CheckCoordInWater(hwRound(Gear^.X), hwRound(Gear^.Y)) then
  3103             AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBubble)
  3108             AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBubble)
  3104         else
  3109         else
  3105             AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace);
  3110             AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace);
  3106 
  3111 
       
  3112     // Get rid of gear and cleanup
  3107     if (hwRound(Gear^.X) > (max(LAND_WIDTH,4096)+2048)) or (hwRound(Gear^.X) < -2048) or ((Gear^.Message and gmDestroy) > 0) then
  3113     if (hwRound(Gear^.X) > (max(LAND_WIDTH,4096)+2048)) or (hwRound(Gear^.X) < -2048) or ((Gear^.Message and gmDestroy) > 0) then
  3108         begin
  3114         begin
  3109         // avoid to play forever (is this necessary?)
  3115         // fail-safe: instanly stop sound if it wasn't disabled before
  3110         StopSoundChan(Gear^.SoundChannel);
  3116         if (Gear^.SoundChannel <> -1) then
       
  3117             begin
       
  3118             StopSoundChan(Gear^.SoundChannel);
       
  3119             Gear^.SoundChannel := -1;
       
  3120             end;
  3111         DeleteGear(Gear)
  3121         DeleteGear(Gear)
  3112         end
  3122         end
  3113 end;
  3123 end;
  3114 
  3124 
  3115 procedure doStepAirAttack(Gear: PGear);
  3125 procedure doStepAirAttack(Gear: PGear);