- Fix problem when clouds number is 0
authorunc0rr
Sun, 27 Jul 2008 23:01:41 +0000
changeset 1132 b4c0698fbb6b
parent 1131 c5b8f2bfa487
child 1133 5d5a912d6fc2
- Fix problem when clouds number is 0 - Swap two sounds used when hedgehog get damage due to fall
hedgewars/GSHandlers.inc
hedgewars/uVisualGears.pas
--- a/hedgewars/GSHandlers.inc	Sun Jul 27 22:26:47 2008 +0000
+++ b/hedgewars/GSHandlers.inc	Sun Jul 27 23:01:41 2008 +0000
@@ -43,9 +43,9 @@
 if _0_4 < Gear^.dY then
 	begin
 	if _0_6 < Gear^.dY then
-		PlaySound(sndOw1, false)
+		PlaySound(sndOw4, false)
 	else
-		PlaySound(sndOw4, false);
+		PlaySound(sndOw1, false);
 
 	dmg:= 1 + hwRound((hwAbs(Gear^.dY) - _0_4) * 70);
 	inc(Gear^.Damage, dmg);
--- a/hedgewars/uVisualGears.pas	Sun Jul 27 22:26:47 2008 +0000
+++ b/hedgewars/uVisualGears.pas	Sun Jul 27 23:01:41 2008 +0000
@@ -256,8 +256,8 @@
 procedure AddClouds;
 var i: LongInt;
 begin
-for i:= 0 to cCloudsNumber do
-    AddVisualGear( - cScreenWidth + i * ((cScreenWidth * 2 + 2304) div cCloudsNumber), -160, vgtCloud)
+for i:= 0 to cCloudsNumber - 1 do
+    AddVisualGear( - cScreenWidth + i * ((cScreenWidth * 2 + 2304) div (cCloudsNumber + 1)), -160, vgtCloud)
 end;
 
 initialization