hedgewars/GSHandlers.inc
branchicegun
changeset 8589 3bb505fc707e
parent 8588 47084c6fcb4e
parent 8564 dadfda4ba248
child 8592 bb724ef609db
child 8599 6bd1950de78b
equal deleted inserted replaced
8588:47084c6fcb4e 8589:3bb505fc707e
  2876 
  2876 
  2877 procedure doStepDrillDrilling(Gear: PGear);
  2877 procedure doStepDrillDrilling(Gear: PGear);
  2878 var 
  2878 var 
  2879     t: PGearArray;
  2879     t: PGearArray;
  2880     ox, oy: hwFloat;
  2880     ox, oy: hwFloat;
       
  2881     tempColl: Word; 
  2881 begin
  2882 begin
  2882     AllInactive := false;
  2883     AllInactive := false;
  2883 
  2884 
  2884     if (Gear^.Timer > 0) and ((Gear^.Timer mod 10) = 0) then
  2885     if (Gear^.Timer > 0) and ((Gear^.Timer mod 10) = 0) then
  2885     begin
  2886     begin
  2894             begin
  2895             begin
  2895             StopSoundChan(Gear^.SoundChannel);
  2896             StopSoundChan(Gear^.SoundChannel);
  2896             exit
  2897             exit
  2897         end
  2898         end
  2898     end;
  2899     end;
  2899 
  2900     tempColl:= Gear^.CollisionMask;
  2900     if GameTicks > Gear^.FlightTime then
  2901     Gear^.CollisionMask:= $007F;
       
  2902     if (TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) <> 0) or TestCollisionXWithGear(Gear, hwSign(Gear^.dX)) or (GameTicks > Gear^.FlightTime) then
  2901         t := CheckGearsCollision(Gear)
  2903         t := CheckGearsCollision(Gear)
  2902         
       
  2903     else t := nil;
  2904     else t := nil;
       
  2905     Gear^.CollisionMask:= tempColl;
  2904     //fixes drill not exploding when touching HH bug
  2906     //fixes drill not exploding when touching HH bug
  2905     
  2907     
  2906     if (Gear^.Timer = 0) or ((t <> nil) and (t^.Count <> 0))
  2908     if (Gear^.Timer = 0) or ((t <> nil) and (t^.Count <> 0))
  2907     or ( ((Gear^.State and gsttmpFlag) = 0) and (TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) = 0) and (not TestCollisionXWithGear(Gear, hwSign(Gear^.dX))))
  2909     or ( ((Gear^.State and gsttmpFlag) = 0) and (TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) = 0) and (not TestCollisionXWithGear(Gear, hwSign(Gear^.dX))))
  2908 // CheckLandValue returns true if the type isn't matched
  2910 // CheckLandValue returns true if the type isn't matched