hedgewars/uGearsHedgehog.pas
changeset 9526 2fd51591b260
parent 9509 5b3f2ea156c9
child 9539 ab44d44a6177
equal deleted inserted replaced
9524:0a52c1dd9400 9526:2fd51591b260
  1273     AddVisualGear(x + hwRound(_50 * slope), y - hwRound(_50 * slope), vgtSmokeTrace); *)
  1273     AddVisualGear(x + hwRound(_50 * slope), y - hwRound(_50 * slope), vgtSmokeTrace); *)
  1274 end;
  1274 end;
  1275 
  1275 
  1276 ////////////////////////////////////////////////////////////////////////////////
  1276 ////////////////////////////////////////////////////////////////////////////////
  1277 procedure doStepHedgehog(Gear: PGear);
  1277 procedure doStepHedgehog(Gear: PGear);
  1278 begin
  1278 var tX: hwFloat;
  1279 if WorldWrap(Gear) and (WorldEdge <> weBounce) and 
  1279 begin
  1280   (Gear = CurrentHedgehog^.Gear) and (CurAmmoGear <> nil) and (CurAmmoGear^.Kind =gtRope) then
  1280 tX:= Gear^.X;
  1281    CurAmmoGear^.PortalCounter:= 1;
  1281 if WorldWrap(Gear) then
       
  1282     begin
       
  1283     if (WorldEdge <> weBounce) and (Gear = CurrentHedgehog^.Gear) and 
       
  1284        (CurAmmoGear <> nil) and (CurAmmoGear^.Kind =gtRope) then
       
  1285        CurAmmoGear^.PortalCounter:= 1;
       
  1286     if (WorldEdge = weWrap) and (TestCollisionXwithGear(Gear, 1) or TestCollisionXwithGear(Gear, -1))  then
       
  1287         begin
       
  1288         Gear^.X:= tX;
       
  1289         Gear^.dX.isNegative:= (hwRound(tX) > leftX+Gear^.Radius*2)
       
  1290         end
       
  1291     end;
  1282 
  1292 
  1283 CheckSum:= CheckSum xor Gear^.Hedgehog^.BotLevel;
  1293 CheckSum:= CheckSum xor Gear^.Hedgehog^.BotLevel;
  1284 if (Gear^.Message and gmDestroy) <> 0 then
  1294 if (Gear^.Message and gmDestroy) <> 0 then
  1285     begin
  1295     begin
  1286     DeleteGear(Gear);
  1296     DeleteGear(Gear);