Engine:
authorsmxx
Mon, 19 Apr 2010 13:31:08 +0000
changeset 3359 d17b9f6adae5
parent 3358 546e75f839ce
child 3360 717b4e46e855
Engine: * Let gears collide once they significantly leave visible area (might need more testing) * Added skipping sound to gears skipping on water surface Frontend: * Fixed loading/saving of control bindings
QTfrontend/team.cpp
hedgewars/GSHandlers.inc
hedgewars/uConsts.pas
share/hedgewars/Data/Sounds/skip.ogg
--- a/QTfrontend/team.cpp	Mon Apr 19 12:47:36 2010 +0000
+++ b/QTfrontend/team.cpp	Mon Apr 19 13:31:08 2010 +0000
@@ -121,7 +121,7 @@
         Hedgehogs[i].Suicides = teamfile.value(hh + "Suicides", 0).toInt();
     }
     for(int i = 0; i < BINDS_NUMBER; i++)
-        binds[i].action = teamfile.value(QString("Binds/%1").arg(binds[i].strbind), cbinds[i].action).toString();
+        binds[i].strbind = teamfile.value(QString("Binds/%1").arg(binds[i].action), cbinds[i].strbind).toString();
     for(int i = 0; i < MAX_ACHIEVEMENTS; i++)
         if(achievements[i][0][0])
             AchievementProgress[i] = teamfile.value(QString("Achievements/%1").arg(achievements[i][0]), 0).toUInt();
@@ -166,7 +166,7 @@
         teamfile.setValue(hh + "Suicides", Hedgehogs[i].Suicides);
     }
     for(int i = 0; i < BINDS_NUMBER; i++)
-        teamfile.setValue(QString("Binds/%1").arg(binds[i].strbind), binds[i].action);
+        teamfile.setValue(QString("Binds/%1").arg(binds[i].action), binds[i].strbind);
     for(int i = 0; i < MAX_ACHIEVEMENTS; i++)
         if(achievements[i][0][0])
             teamfile.setValue(QString("Achievements/%1").arg(achievements[i][0]), AchievementProgress[i]);
--- a/hedgewars/GSHandlers.inc	Mon Apr 19 12:47:36 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Mon Apr 19 13:31:08 2010 +0000
@@ -65,7 +65,8 @@
        Gear^.dY.isNegative:= true;
        Gear^.dY:= Gear^.dY * skipDecay;
        Gear^.dX:= Gear^.dX * skipDecay;
-       CheckGearDrowning:= false
+       CheckGearDrowning:= false;
+       PlaySound(sndSkip)
        end
     else
         begin
@@ -78,9 +79,9 @@
             begin
             Gear^.State:= Gear^.State and (not gstHHDriven);
             AddCaption(Format(GetEventString(eidDrowned), PHedgehog(Gear^.Hedgehog)^.Name), cWhiteColor, capgrpMessage);
-            end
+            end;
+        PlaySound(sndSplash)
         end;
-    PlaySound(sndSplash);
     
     if not cReducedQuality then 
         begin
@@ -98,7 +99,7 @@
             end
         end;
     end
-    else
+else
     CheckGearDrowning:= false
 end;
 
@@ -179,6 +180,13 @@
 tdX:= Gear^.dX;
 tdY:= Gear^.dY;
 
+// might need some testing/adjustments - just to avoid projectiles to fly forever (accelerated by wind/skips)
+if (hwRound(Gear^.X) < LAND_WIDTH div -2) or (hwRound(Gear^.X) > LAND_WIDTH * 3 div 2) then
+    begin
+    Gear^.State:= Gear^.State or gstCollision;
+    exit
+    end;
+
 if Gear^.dY.isNegative then
     begin
     isFalling:= true;
--- a/hedgewars/uConsts.pas	Mon Apr 19 12:47:36 2010 +0000
+++ b/hedgewars/uConsts.pas	Mon Apr 19 13:31:08 2010 +0000
@@ -113,7 +113,8 @@
             sndHellishImpact1, sndHellishImpact2, sndHellishImpact3, sndHellishImpact4,
             sndMelonImpact, sndDroplet1, sndDroplet2, sndDroplet3, sndEggBreak, sndDrillRocket,
             sndPoisonCough, sndPoisonMoan, sndBirdyLay, sndWhistle, sndBeeWater,
-            sndPiano0, sndPiano1, sndPiano2, sndPiano3, sndPiano4, sndPiano5, sndPiano6, sndPiano7, sndPiano8);
+            sndPiano0, sndPiano1, sndPiano2, sndPiano3, sndPiano4, sndPiano5, sndPiano6, sndPiano7, sndPiano8,
+            sndSkip);
 
     TAmmoType  = (amNothing, amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amPickHammer,
             amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch, amWhip,
@@ -858,7 +859,8 @@
             (FileName:                  'egg.ogg'; Path: ptSounds),// sndPiano5
             (FileName:                  'egg.ogg'; Path: ptSounds),// sndPiano6
             (FileName:                  'egg.ogg'; Path: ptSounds),// sndPiano7
-            (FileName:                  'egg.ogg'; Path: ptSounds) // sndPiano8
+            (FileName:                  'egg.ogg'; Path: ptSounds),// sndPiano8
+            (FileName:                 'skip.ogg'; Path: ptSounds) // sndSkip
             );
 
     Ammoz: array [TAmmoType] of record
Binary file share/hedgewars/Data/Sounds/skip.ogg has changed