hedgewars/GSHandlers.inc
changeset 6785 a8aa5984185f
parent 6765 8fcd2508c49f
child 6786 f631b8350b53
equal deleted inserted replaced
6784:2c02ccb8f4ec 6785:a8aa5984185f
  3464     if ((HHGear^.State and gstHHDriven) = 0) or (Gear^.Timer = 0) then
  3464     if ((HHGear^.State and gstHHDriven) = 0) or (Gear^.Timer = 0) then
  3465         begin
  3465         begin
  3466         fChanged := true;
  3466         fChanged := true;
  3467         if Gear^.Angle > 2048 then
  3467         if Gear^.Angle > 2048 then
  3468             dec(Gear^.Angle)
  3468             dec(Gear^.Angle)
  3469         else
  3469         else if Gear^.Angle < 2048 then
  3470             if Gear^.Angle < 2048 then
  3470             inc(Gear^.Angle)
  3471                 inc(Gear^.Angle)
  3471         else fChanged := false
  3472         else
       
  3473             fChanged := false
       
  3474     end
  3472     end
  3475     else
  3473     else
  3476         begin
  3474         begin
  3477         if ((Gear^.Message and gmLeft) <> 0) then
  3475         if ((Gear^.Message and gmLeft) <> 0) then
  3478             begin
  3476             begin
  4032         // end of list?
  4030         // end of list?
  4033         if iterator = nil then
  4031         if iterator = nil then
  4034             break;
  4032             break;
  4035 
  4033 
  4036         // don't port portals or other gear that wouldn't make sense
  4034         // don't port portals or other gear that wouldn't make sense
  4037         if (iterator^.Kind in [gtPortal, gtRope, gtRCPlane])
  4035         if (iterator^.Kind in [gtPortal, gtRope])
  4038         or (iterator^.PortalCounter > 32) then
  4036         or (iterator^.PortalCounter > 32) then
  4039             continue;
  4037             continue;
  4040 
  4038 
  4041         // don't port hogs on rope
  4039         // don't port hogs on rope
  4042         // TODO: this will also prevent hogs while falling after rope use from
  4040         // TODO: this will also prevent hogs while falling after rope use from
  4269             iterator^.PortalCounter:= 33
  4267             iterator^.PortalCounter:= 33
  4270         else
  4268         else
  4271             begin
  4269             begin
  4272             inc(iterator^.PortalCounter);
  4270             inc(iterator^.PortalCounter);
  4273             iterator^.State:= iterator^.State and (not gstHHHJump)
  4271             iterator^.State:= iterator^.State and (not gstHHHJump)
       
  4272             end;
       
  4273 
       
  4274         // is it worth adding an arcsin table?  Just how often would we end up doing something like this?
       
  4275         if iterator^.Kind = gtRCPlane then
       
  4276             begin
       
  4277             // recycling as temp vars
       
  4278             resety.isNegative:= false;
       
  4279             resety.QWordValue:= 4294967296 * 112;
       
  4280             resetx.isNegative:= false;
       
  4281             resetx.QWordValue:= 4294967296 * 35;
       
  4282             resetdx.isNegative:= false;
       
  4283             resetdx.QWordValue:= 4294967296 * 1152;
       
  4284     
       
  4285             resetdy:=hwAbs(iterator^.dX*4);
       
  4286             resetdy:= resetdy + hwPow(resetdy,3)/_6 + _3 * hwPow(resetdy,5) / _40 + _5 * hwPow(resetdy,7) / resety + resetx * hwPow(resetdy,9) / resetdx;
       
  4287             iterator^.Angle:= hwRound(resetdy*_2048 / _PI)
  4274             end;
  4288             end;
  4275 
  4289 
  4276         if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil)
  4290         if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil)
  4277         and (iterator = CurrentHedgehog^.Gear)
  4291         and (iterator = CurrentHedgehog^.Gear)
  4278         and (CurAmmoGear <> nil)
  4292         and (CurAmmoGear <> nil)