hedgewars/GSHandlers.inc
changeset 7309 5bb4bd846c87
parent 7305 b242e91a92a9
child 7310 7f8d62b869bd
equal deleted inserted replaced
7308:40aa797c4ef0 7309:5bb4bd846c87
  4409     y := hwRound(Gear^.Y);
  4409     y := hwRound(Gear^.Y);
  4410     tx := 0;
  4410     tx := 0;
  4411     ty := 0;
  4411     ty := 0;
  4412     // avoid compiler hints
  4412     // avoid compiler hints
  4413 
  4413 
  4414     if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0) and (Land[y, x] and ($FF00 and not lfBouncy) <> 0) then
  4414     if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0) and (Land[y, x] > 255) then
  4415         begin
  4415         begin
  4416         Gear^.State := Gear^.State or gstCollision;
  4416         Gear^.State := Gear^.State or gstCollision;
  4417         Gear^.State := Gear^.State and (not gstMoving);
  4417         Gear^.State := Gear^.State and (not gstMoving);
  4418         
  4418         
  4419         if not CalcSlopeTangent(Gear, x, y, tx, ty, 255)
  4419         if not CalcSlopeTangent(Gear, x, y, tx, ty, 255)
       
  4420         or (Land[y, x] and lfBouncy <> 0)
  4420         or (DistanceI(tx,ty) < _12) then // reject shots at too irregular terrain
  4421         or (DistanceI(tx,ty) < _12) then // reject shots at too irregular terrain
  4421             begin
  4422             begin
  4422             loadNewPortalBall(Gear, true);
  4423             loadNewPortalBall(Gear, true);
  4423             EXIT;
  4424             EXIT;
  4424             end;
  4425             end;