Fix wrong ice beam angle if it goes diagonally up out of map thru world wrap (
bug #718)
--- a/ChangeLog.txt Sat Jan 12 06:38:20 2019 +0100
+++ b/ChangeLog.txt Sat Jan 12 23:26:33 2019 +0100
@@ -29,6 +29,7 @@
Graphics:
+ Show contour of flying saucer when in highly opaque water
+ * Fix wrong ice beam angle if it goes diagonally up out of map through world wrap
* Fix double water splash when flying saucer drowns
Game HUD:
--- a/hedgewars/uGearsHandlersMess.pas Sat Jan 12 06:38:20 2019 +0100
+++ b/hedgewars/uGearsHandlersMess.pas Sat Jan 12 23:26:33 2019 +0100
@@ -6377,7 +6377,11 @@
Timer := iceWaitCollision;
FlightTime := 0;
end
- else
+ // Extend ice beam, unless it is far outside he map boundaries
+ else if (not ((hwRound(X + dX) > max(LAND_WIDTH,4096)*2) or
+ (hwRound(X + dX) < -max(LAND_WIDTH,4096)*2) or
+ (hwRound(Y + dY) < -max(LAND_HEIGHT,4096)*2) or
+ (hwRound(Y + dY) > max(LAND_HEIGHT,4096)+512))) then
begin
X:= X + dX;
Y:= Y + dY;
@@ -6582,16 +6586,6 @@
Y:= HHGear^.Y
end
end;
- if (gX > max(LAND_WIDTH,4096)*2) or
- (gX < -max(LAND_WIDTH,4096)) or
- (gY < -max(LAND_HEIGHT,4096)) or
- (gY > max(LAND_HEIGHT,4096)+512) then
- begin
- //X:= HHGear^.X;
- //Y:= HHGear^.Y
- Target.X:= gX;
- Target.Y:= gY;
- end
end
end;
end;