hedgewars/uGearsHandlersMess.pas
changeset 13990 1670fc3957df
parent 13989 817dc8b67b0d
child 13999 996ef4c5d064
equal deleted inserted replaced
13989:817dc8b67b0d 13990:1670fc3957df
  5591 begin
  5591 begin
  5592     AllInactive := false;
  5592     AllInactive := false;
  5593     HHGear := Gear^.Hedgehog^.Gear;
  5593     HHGear := Gear^.Hedgehog^.Gear;
  5594     if HHGear = nil then
  5594     if HHGear = nil then
  5595         begin
  5595         begin
       
  5596         StopSoundChan(gear^.SoundChannel);
  5596         DeleteGear(gear);
  5597         DeleteGear(gear);
  5597         exit
  5598         exit
  5598         end;
  5599         end;
  5599     HedgehogChAngle(HHGear);
  5600     HedgehogChAngle(HHGear);
  5600     gX := hwRound(Gear^.X) + GetLaunchX(amBallgun, hwSign(HHGear^.dX), HHGear^.Angle);
  5601     gX := hwRound(Gear^.X) + GetLaunchX(amBallgun, hwSign(HHGear^.dX), HHGear^.Angle);
  5637 
  5638 
  5638     if (Gear^.Health = 0) or ((HHGear^.State and gstHHDriven) = 0) or ((HHGear^.Message and gmAttack) <> 0) then
  5639     if (Gear^.Health = 0) or ((HHGear^.State and gstHHDriven) = 0) or ((HHGear^.Message and gmAttack) <> 0) then
  5639         begin
  5640         begin
  5640         HHGear^.Message:= HHGear^.Message and (not gmAttack);
  5641         HHGear^.Message:= HHGear^.Message and (not gmAttack);
  5641         HHGear^.State := HHGear^.State and (not gstNotKickable);
  5642         HHGear^.State := HHGear^.State and (not gstNotKickable);
       
  5643         StopSoundChan(gear^.SoundChannel);
  5642         DeleteGear(Gear);
  5644         DeleteGear(Gear);
  5643         AfterAttack
  5645         AfterAttack
  5644         end
  5646         end
  5645     else
  5647     else
  5646         begin
  5648         begin
  5660     HHGear: PGear;
  5662     HHGear: PGear;
  5661 begin
  5663 begin
  5662     HHGear := Gear^.Hedgehog^.Gear;
  5664     HHGear := Gear^.Hedgehog^.Gear;
  5663     HHGear^.Message := HHGear^.Message and (not (gmUp or gmDown or gmLeft or gmRight or gmAttack));
  5665     HHGear^.Message := HHGear^.Message and (not (gmUp or gmDown or gmLeft or gmRight or gmAttack));
  5664     HHGear^.State := HHGear^.State or gstNotKickable;
  5666     HHGear^.State := HHGear^.State or gstNotKickable;
       
  5667     Gear^.SoundChannel := LoopSound(sndLandGun);
  5665     Gear^.doStep := @doStepLandGunWork
  5668     Gear^.doStep := @doStepLandGunWork
  5666 end;
  5669 end;
  5667 
  5670 
  5668 ////////////////////////////////////////////////////////////////////////////////
  5671 ////////////////////////////////////////////////////////////////////////////////
  5669 procedure doStepPoisonCloud(Gear: PGear);
  5672 procedure doStepPoisonCloud(Gear: PGear);