hedgewars/GSHandlers.inc
changeset 3406 f4bdebced042
parent 3404 d445798e5fe2
child 3407 dcc129c4352e
equal deleted inserted replaced
3405:8fdb08497bf1 3406:f4bdebced042
  3131             AllInactive:= false;
  3131             AllInactive:= false;
  3132             // This jiggles gears, to ensure a portal connection just placed under a gear takes effect.
  3132             // This jiggles gears, to ensure a portal connection just placed under a gear takes effect.
  3133             iterator:= GearsList;
  3133             iterator:= GearsList;
  3134             while iterator <> nil do
  3134             while iterator <> nil do
  3135                 begin
  3135                 begin
  3136                 iterator^.Active:= true;
  3136                 if iterator^.Kind <> gtPortal then
  3137                 if iterator^.dY.QWordValue = _0.QWordValue then iterator^.dY.isNegative:= false;
  3137                     begin
  3138                 iterator^.State:= iterator^.State or gstMoving;
  3138                     iterator^.Active:= true;
  3139                 DeleteCI(iterator);
  3139                     if iterator^.dY.QWordValue = _0.QWordValue then iterator^.dY.isNegative:= false;
  3140                 inc(iterator^.dY.QWordValue,10);
  3140                     iterator^.State:= iterator^.State or gstMoving;
  3141                 iterator:= iterator^.NextGear;
  3141                     DeleteCI(iterator);
       
  3142                     inc(iterator^.dY.QWordValue,10);
       
  3143                     end;
       
  3144                 iterator:= iterator^.NextGear
  3142                 end;
  3145                 end;
  3143             doStepPortal(Gear);
  3146             doStepPortal(Gear);
  3144             if Gear^.IntersectGear <> nil then doStepPortal(Gear^.IntersectGear);
  3147             if Gear^.IntersectGear <> nil then Gear^.IntersectGear^.doStep(Gear^.IntersectGear);
  3145             end
  3148             end
  3146         end
  3149         end
  3147     end
  3150     end
  3148 else if (y > cWaterLine + cVisibleWater + Gear^.Radius) or (y < -LAND_WIDTH) or (x > LAND_WIDTH + LAND_WIDTH) or (x < -LAND_WIDTH) then
  3151 else if (y > cWaterLine + cVisibleWater + Gear^.Radius) or (y < -LAND_WIDTH) or (x > LAND_WIDTH + LAND_WIDTH) or (x < -LAND_WIDTH) then
  3149     begin
  3152     begin