hedgewars/uCollisions.pas
changeset 9041 aefe46d64dd9
parent 8751 4609823efc94
child 9080 9b42757d7e71
equal deleted inserted replaced
9040:282c7ef1822d 9041:aefe46d64dd9
    81 with cinfos[Count] do
    81 with cinfos[Count] do
    82     begin
    82     begin
    83     X:= hwRound(Gear^.X);
    83     X:= hwRound(Gear^.X);
    84     Y:= hwRound(Gear^.Y);
    84     Y:= hwRound(Gear^.Y);
    85     Radius:= Gear^.Radius;
    85     Radius:= Gear^.Radius;
    86     ChangeRoundInLand(X, Y, Radius - 1, true, (Gear = CurrentHedgehog^.Gear) or (Gear^.Kind = gtCase));
    86     ChangeRoundInLand(X, Y, Radius - 1, true, (Gear = CurrentHedgehog^.Gear) or ((Gear^.Kind = gtCase) and (Gear^.State and gstFrozen <> 0)));
    87     cGear:= Gear
    87     cGear:= Gear
    88     end;
    88     end;
    89 Gear^.CollisionIndex:= Count;
    89 Gear^.CollisionIndex:= Count;
    90 inc(Count);
    90 inc(Count);
    91 // mines are the easiest way to overflow collision
    91 // mines are the easiest way to overflow collision
   102 procedure DeleteCI(Gear: PGear);
   102 procedure DeleteCI(Gear: PGear);
   103 begin
   103 begin
   104 if Gear^.CollisionIndex >= 0 then
   104 if Gear^.CollisionIndex >= 0 then
   105     begin
   105     begin
   106     with cinfos[Gear^.CollisionIndex] do
   106     with cinfos[Gear^.CollisionIndex] do
   107         ChangeRoundInLand(X, Y, Radius - 1, false, (Gear = CurrentHedgehog^.Gear) or (Gear^.Kind = gtCase));
   107         ChangeRoundInLand(X, Y, Radius - 1, false, (Gear = CurrentHedgehog^.Gear) or ((Gear^.Kind = gtCase) and (Gear^.State and gstFrozen <> 0)));
   108     cinfos[Gear^.CollisionIndex]:= cinfos[Pred(Count)];
   108     cinfos[Gear^.CollisionIndex]:= cinfos[Pred(Count)];
   109     cinfos[Gear^.CollisionIndex].cGear^.CollisionIndex:= Gear^.CollisionIndex;
   109     cinfos[Gear^.CollisionIndex].cGear^.CollisionIndex:= Gear^.CollisionIndex;
   110     Gear^.CollisionIndex:= -1;
   110     Gear^.CollisionIndex:= -1;
   111     dec(Count)
   111     dec(Count)
   112     end;
   112     end;