hedgewars/GSHandlers.inc
changeset 7784 cf6261f7fdb5
parent 7777 e0be9fbc21b4
child 7829 c1dc7839d7b9
equal deleted inserted replaced
7783:ad238b677572 7784:cf6261f7fdb5
  4042                 begin
  4042                 begin
  4043                 // This jiggles gears, to ensure a portal connection just placed under a gear takes effect.
  4043                 // This jiggles gears, to ensure a portal connection just placed under a gear takes effect.
  4044                 iterator:= GearsList;
  4044                 iterator:= GearsList;
  4045                 while iterator <> nil do
  4045                 while iterator <> nil do
  4046                     begin
  4046                     begin
  4047                     if not (iterator^.Kind in [gtPortal, gtAirAttack]) and ((iterator^.Hedgehog <> CurrentHedgehog)
  4047                     if not (iterator^.Kind in [gtPortal, gtAirAttack, gtKnife]) and ((iterator^.Hedgehog <> CurrentHedgehog)
  4048                     or ((iterator^.Message and gmAllStoppable) = 0)) then
  4048                     or ((iterator^.Message and gmAllStoppable) = 0)) then
  4049                             begin
  4049                             begin
  4050                             iterator^.Active:= true;
  4050                             iterator^.Active:= true;
  4051                             if iterator^.dY.QWordValue = _0.QWordValue then
  4051                             if iterator^.dY.QWordValue = _0.QWordValue then
  4052                                 iterator^.dY.isNegative:= false;
  4052                                 iterator^.dY.isNegative:= false;
  5275         if la = _10000 then
  5275         if la = _10000 then
  5276             begin
  5276             begin
  5277             // debug for when we couldn't get an angle
  5277             // debug for when we couldn't get an angle
  5278             //AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeWhite);
  5278             //AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeWhite);
  5279 *)
  5279 *)
  5280             Gear^.DirAngle:= DxDy2Angle(Gear^.dX, Gear^.dY) + (random(20)-10);
  5280             Gear^.DirAngle:= DxDy2Angle(Gear^.dX, Gear^.dY) + (random(30)-15);
  5281             if (Gear^.dX.isNegative and Gear^.dY.isNegative) or
  5281             if (Gear^.dX.isNegative and Gear^.dY.isNegative) or
  5282              ((not Gear^.dX.isNegative) and (not Gear^.dY.isNegative)) then Gear^.DirAngle:= Gear^.DirAngle-90;
  5282              ((not Gear^.dX.isNegative) and (not Gear^.dY.isNegative)) then Gear^.DirAngle:= Gear^.DirAngle-90;
  5283  //           end
  5283  //           end
  5284  //       else Gear^.DirAngle:= hwFloat2Float(la)*90; // sheepluva's comment claims 45deg = 0.5 - yet orientation doesn't seem consistent?
  5284  //       else Gear^.DirAngle:= hwFloat2Float(la)*90; // sheepluva's comment claims 45deg = 0.5 - yet orientation doesn't seem consistent?
  5285  //       AddFileLog('la: '+floattostr(la)+' DirAngle: '+inttostr(round(Gear^.DirAngle)));
  5285  //       AddFileLog('la: '+floattostr(la)+' DirAngle: '+inttostr(round(Gear^.DirAngle)));