hedgewars/GSHandlers.inc
changeset 5076 b3bb27f4ba6b
parent 5067 57101536cf86
child 5121 2d34ec60992c
equal deleted inserted replaced
5075:59b13b38a827 5076:b3bb27f4ba6b
   961             if VGear <> nil then
   961             if VGear <> nil then
   962             begin
   962             begin
   963                 VGear^.Angle := DxDy2Angle(-Gear^.dX, Gear^.dY);
   963                 VGear^.Angle := DxDy2Angle(-Gear^.dX, Gear^.dY);
   964             end;
   964             end;
   965         end;
   965         end;
   966         
   966        
   967         // Bullet trail
   967         if Gear^.PortalCounter = 0 then
   968         VGear := AddVisualGear(
   968             begin 
   969             hwround(CurrentHedgehog^.Gear^.X) + GetLaunchX(CurrentHedgehog^.CurAmmoType, hwSign(CurrentHedgehog^.Gear^.dX), CurrentHedgehog^.Gear^.Angle), 
   969             // Bullet trail
   970             hwround(CurrentHedgehog^.Gear^.Y) + GetLaunchY(CurrentHedgehog^.CurAmmoType, CurrentHedgehog^.Gear^.Angle),
   970             VGear := AddVisualGear(
   971             vgtLineTrail
   971                 hwround(CurrentHedgehog^.Gear^.X) + GetLaunchX(CurrentHedgehog^.CurAmmoType, hwSign(CurrentHedgehog^.Gear^.dX), CurrentHedgehog^.Gear^.Angle), 
   972         );
   972                 hwround(CurrentHedgehog^.Gear^.Y) + GetLaunchY(CurrentHedgehog^.CurAmmoType, CurrentHedgehog^.Gear^.Angle),
   973         if VGear <> nil then
   973                 vgtLineTrail
   974         begin
   974             );
   975             // http://mantis.freepascal.org/view.php?id=17714 hits again
   975             if VGear <> nil then
   976             VGear^.dX := Gear^.X.QWordValue / SignAs(_1,_1).QWordValue;
   976                 begin
   977             VGear^.dY := Gear^.Y.QWordValue / SignAs(_1,_1).QWordValue;
   977                 // http://mantis.freepascal.org/view.php?id=17714 hits again
   978             
   978                 VGear^.dX := Gear^.X.QWordValue / SignAs(_1,_1).QWordValue;
   979             // reached edge of land. assume infinite beam. Extend it way out past camera
   979                 VGear^.dY := Gear^.Y.QWordValue / SignAs(_1,_1).QWordValue;
   980             if (hwRound(Gear^.X) and LAND_WIDTH_MASK <> 0) 
   980                 
   981                 or (hwRound(Gear^.Y) and LAND_HEIGHT_MASK <> 0) then
   981                 // reached edge of land. assume infinite beam. Extend it way out past camera
   982             begin
   982                 if (hwRound(Gear^.X) and LAND_WIDTH_MASK <> 0) 
   983                 VGear^.dX := VGear^.dX + (CurrentHedgehog^.Gear^.dX * LAND_WIDTH).QWordValue / SignAs(_1,_1).QWordValue;
   983                     or (hwRound(Gear^.Y) and LAND_HEIGHT_MASK <> 0) then
   984                 VGear^.dY := VGear^.dY + (CurrentHedgehog^.Gear^.dY * LAND_WIDTH).QWordValue / SignAs(_1,_1).QWordValue;
   984                     begin
       
   985                     VGear^.dX := VGear^.dX + (CurrentHedgehog^.Gear^.dX * LAND_WIDTH).QWordValue / SignAs(_1,_1).QWordValue;
       
   986                     VGear^.dY := VGear^.dY + (CurrentHedgehog^.Gear^.dY * LAND_WIDTH).QWordValue / SignAs(_1,_1).QWordValue;
       
   987                     end;
       
   988                 
       
   989                 VGear^.Timer := 200;
       
   990                 end
   985             end;
   991             end;
   986             
       
   987             VGear^.Timer := 200;
       
   988         end;
       
   989         
       
   990         Gear^.doStep := @doStepShotIdle
   992         Gear^.doStep := @doStepShotIdle
   991     end;
   993     end;
   992 end;
   994 end;
   993 
   995 
   994 procedure doStepDEagleShot(Gear: PGear);
   996 procedure doStepDEagleShot(Gear: PGear);