hedgewars/GSHandlers.inc
changeset 4281 e033cf015b2c
parent 4279 b697a26ed538
child 4297 88714b6f3676
equal deleted inserted replaced
4279:b697a26ed538 4281:e033cf015b2c
   759             hwround(CurrentHedgehog^.Gear^.Y) + GetLaunchY(CurrentHedgehog^.CurAmmoType, CurrentHedgehog^.Gear^.Angle),
   759             hwround(CurrentHedgehog^.Gear^.Y) + GetLaunchY(CurrentHedgehog^.CurAmmoType, CurrentHedgehog^.Gear^.Angle),
   760             vgtLineTrail
   760             vgtLineTrail
   761         );
   761         );
   762         if trail <> nil then
   762         if trail <> nil then
   763         begin
   763         begin
   764             trail^.dX := Gear^.X.QWordValue / _1.QWordValue;
   764             // http://mantis.freepascal.org/view.php?id=17714 hits again
   765             trail^.dY := Gear^.Y.QWordValue / _1.QWordValue;
   765             trail^.dX := Gear^.X.QWordValue / SignAs(_1,_1).QWordValue;
       
   766             trail^.dY := Gear^.Y.QWordValue / SignAs(_1,_1).QWordValue;
   766             
   767             
   767             // reached edge of land. assume infinite beam. Extend it way out past camera
   768             // reached edge of land. assume infinite beam. Extend it way out past camera
   768             if (hwRound(Gear^.X) and LAND_WIDTH_MASK <> 0) 
   769             if (hwRound(Gear^.X) and LAND_WIDTH_MASK <> 0) 
   769                 or (hwRound(Gear^.Y) and LAND_HEIGHT_MASK <> 0) then
   770                 or (hwRound(Gear^.Y) and LAND_HEIGHT_MASK <> 0) then
   770             begin
   771             begin
   771                 trail^.dX := trail^.dX + (CurrentHedgehog^.Gear^.dX * LAND_WIDTH).QWordValue / _1.QWordValue;
   772                 trail^.dX := trail^.dX + (CurrentHedgehog^.Gear^.dX * LAND_WIDTH).QWordValue / SignAs(_1,_1).QWordValue;
   772                 trail^.dY := trail^.dY + (CurrentHedgehog^.Gear^.dY * LAND_WIDTH).QWordValue / _1.QWordValue;
   773                 trail^.dY := trail^.dY + (CurrentHedgehog^.Gear^.dY * LAND_WIDTH).QWordValue / SignAs(_1,_1).QWordValue;
   773             end;
   774             end;
   774             
   775             
   775             trail^.Timer := 200;
   776             trail^.Timer := 200;
   776         end;
   777         end;
   777         
   778