hedgewars/uGearsHandlersMess.pas
changeset 9473 a51a69094c24
parent 9470 9ed07a96349d
child 9477 0463f747e839
equal deleted inserted replaced
9470:9ed07a96349d 9473:a51a69094c24
   282     //tmp: QWord;
   282     //tmp: QWord;
   283     tdX, tdY: hwFloat;
   283     tdX, tdY: hwFloat;
   284     collV, collH: LongInt;
   284     collV, collH: LongInt;
   285     land: word;
   285     land: word;
   286 begin
   286 begin
       
   287     WorldWrap(Gear);
       
   288 
   287     // clip velocity at 2 - over 1 per pixel, but really shouldn't cause many actual problems.
   289     // clip velocity at 2 - over 1 per pixel, but really shouldn't cause many actual problems.
   288     if Gear^.dX.Round > 2 then
   290     if Gear^.dX.Round > 2 then
   289         Gear^.dX.QWordValue:= 8589934592;
   291         Gear^.dX.QWordValue:= 8589934592;
   290     if Gear^.dY.Round > 2 then
   292     if Gear^.dY.Round > 2 then
   291         Gear^.dY.QWordValue:= 8589934592;
   293         Gear^.dY.QWordValue:= 8589934592;
   299     Gear^.State := Gear^.State and (not gstCollision);
   301     Gear^.State := Gear^.State and (not gstCollision);
   300     collV := 0;
   302     collV := 0;
   301     collH := 0;
   303     collH := 0;
   302     tdX := Gear^.dX;
   304     tdX := Gear^.dX;
   303     tdY := Gear^.dY;
   305     tdY := Gear^.dY;
   304 
       
   305 
       
   306 
   306 
   307 // might need some testing/adjustments - just to avoid projectiles to fly forever (accelerated by wind/skips)
   307 // might need some testing/adjustments - just to avoid projectiles to fly forever (accelerated by wind/skips)
   308     if (hwRound(Gear^.X) < min(LAND_WIDTH div -2, -2048))
   308     if (hwRound(Gear^.X) < min(LAND_WIDTH div -2, -2048))
   309     or (hwRound(Gear^.X) > max(LAND_WIDTH * 3 div 2, 6144)) then
   309     or (hwRound(Gear^.X) > max(LAND_WIDTH * 3 div 2, 6144)) then
   310         Gear^.State := Gear^.State or gstCollision;
   310         Gear^.State := Gear^.State or gstCollision;
   887     gX,gY,i: LongInt;
   887     gX,gY,i: LongInt;
   888     uw, nuw: boolean;
   888     uw, nuw: boolean;
   889     flower: PVisualGear;
   889     flower: PVisualGear;
   890 
   890 
   891 begin
   891 begin
       
   892     WorldWrap(Gear);
   892     AllInactive := false;
   893     AllInactive := false;
   893     gX := hwRound(Gear^.X);
   894     gX := hwRound(Gear^.X);
   894     gY := hwRound(Gear^.Y);
   895     gY := hwRound(Gear^.Y);
   895     uw := (Gear^.Tag <> 0); // was bee underwater last tick?
   896     uw := (Gear^.Tag <> 0); // was bee underwater last tick?
   896     nuw := (cWaterLine < gy + Gear^.Radius); // is bee underwater now?
   897     nuw := (cWaterLine < gy + Gear^.Radius); // is bee underwater now?
  4635 end;
  4636 end;
  4636 
  4637 
  4637 ////////////////////////////////////////////////////////////////////////////////
  4638 ////////////////////////////////////////////////////////////////////////////////
  4638 procedure doStepPoisonCloud(Gear: PGear);
  4639 procedure doStepPoisonCloud(Gear: PGear);
  4639 begin
  4640 begin
       
  4641     WorldWrap(Gear);
  4640     if Gear^.Timer = 0 then
  4642     if Gear^.Timer = 0 then
  4641         begin
  4643         begin
  4642         DeleteGear(Gear);
  4644         DeleteGear(Gear);
  4643         exit
  4645         exit
  4644         end;
  4646         end;