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