# HG changeset patch # User sheepluva # Date 1315664498 -7200 # Node ID 7ea0745912f7160a7e94f4e2912ebb6d59ca141a # Parent 180ffae2c03934e41a38f0e7fee6f8af36e5327e fix: let's use less random code for drawing the bullet trajectory diff -r 180ffae2c039 -r 7ea0745912f7 hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Sat Sep 10 10:13:19 2011 -0400 +++ b/hedgewars/GSHandlers.inc Sat Sep 10 16:21:38 2011 +0200 @@ -1035,14 +1035,19 @@ // http://mantis.freepascal.org/view.php?id=17714 hits again VGear^.dX := Gear^.X.QWordValue / SignAs(_1,_1).QWordValue; VGear^.dY := Gear^.Y.QWordValue / SignAs(_1,_1).QWordValue; + + if (Gear^.X.isNegative) then VGear^.dX:= -VGear^.dX; + if (Gear^.Y.isNegative) then VGear^.dY:= -VGear^.dY; // reached edge of land. assume infinite beam. Extend it way out past camera if (hwRound(Gear^.X) and LAND_WIDTH_MASK <> 0) or (hwRound(Gear^.Y) and LAND_HEIGHT_MASK <> 0) then - begin - VGear^.dX := VGear^.dX + (CurrentHedgehog^.Gear^.dX * LAND_WIDTH).QWordValue / SignAs(_1,_1).QWordValue; - VGear^.dY := VGear^.dY + (CurrentHedgehog^.Gear^.dY * LAND_WIDTH).QWordValue / SignAs(_1,_1).QWordValue; - end; + // only extend if not under water + if hwRound(Gear^.Y) < cWaterLine then + begin + VGear^.dX := VGear^.dX + LAND_WIDTH * (VGear^.dX - VGear^.X); + VGear^.dY := VGear^.dY + LAND_WIDTH * (VGear^.dY - VGear^.Y); + end; VGear^.Timer := 200; end