revert the restoration of non-vgt health gears. desyncs continued with it, and furthermore, occur in r3489 too
authornemo
Fri, 14 May 2010 23:42:56 +0000
changeset 3461 0781275649e9
parent 3460 d957d5f7b58d
child 3462 4b36933dce1d
revert the restoration of non-vgt health gears. desyncs continued with it, and furthermore, occur in r3489 too
hedgewars/GSHandlers.inc
hedgewars/GearDrawing.inc
hedgewars/uConsts.pas
hedgewars/uGears.pas
--- a/hedgewars/GSHandlers.inc	Fri May 14 16:02:27 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Fri May 14 23:42:56 2010 +0000
@@ -447,50 +447,6 @@
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
-procedure doStepHealthTagWork(Gear: PGear);
-begin
-if Gear^.Kind = gtHealthTag then
-    AllInactive:= false;
-
-dec(Gear^.Timer);
-Gear^.Y:= Gear^.Y + Gear^.dY;
-
-if Gear^.Timer = 0 then
-    begin
-    if (Gear^.Kind = gtHealthTag) and (PHedgehog(Gear^.Hedgehog)^.Gear <> nil) then
-        PHedgehog(Gear^.Hedgehog)^.Gear^.Active:= true; // to let current hh die
-    DeleteGear(Gear)
-    end
-end;
-
-procedure doStepHealthTagWorkUnderWater(Gear: PGear);
-begin
-AllInactive:= false;
-
-Gear^.Y:= Gear^.Y - _0_08;
-
-if hwRound(Gear^.Y) < cWaterLine + 10 then
-    DeleteGear(Gear)
-end;
-
-procedure doStepHealthTag(Gear: PGear);
-var s: shortstring;
-begin
-AllInactive:= false;
-Gear^.dY:= -_0_08;
-
-str(Gear^.State, s);
-Gear^.Tex:= RenderStringTex(s, PHedgehog(Gear^.Hedgehog)^.Team^.Clan^.Color, fnt16);
-
-if hwRound(Gear^.Y) < cWaterLine then
-    Gear^.doStep:= @doStepHealthTagWork
-else
-    Gear^.doStep:= @doStepHealthTagWorkUnderWater;
-
-Gear^.Y:= Gear^.Y - int2hwFloat(Gear^.Tex^.h)
-end;
-
-////////////////////////////////////////////////////////////////////////////////
 procedure doStepGrave(Gear: PGear);
 begin
     AllInactive := false;
--- a/hedgewars/GearDrawing.inc	Fri May 14 16:02:27 2010 +0000
+++ b/hedgewars/GearDrawing.inc	Fri May 14 23:42:56 2010 +0000
@@ -667,8 +667,6 @@
         gtHedgehog: DrawHH(Gear);
 
     gtAmmo_Grenade: DrawRotated(sprGrenade, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
-    
-       gtHealthTag: if Gear^.Tex <> nil then DrawCentered(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tex);
 
            gtGrave: DrawTextureF(PHedgehog(Gear^.Hedgehog)^.Team^.GraveTex, 1, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, (GameTicks shr 7+Gear^.uid) and 7, 1, 32, 32);
 
--- a/hedgewars/uConsts.pas	Fri May 14 16:02:27 2010 +0000
+++ b/hedgewars/uConsts.pas	Fri May 14 23:42:56 2010 +0000
@@ -85,7 +85,7 @@
             gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece, // 34
             gtHellishBomb, gtWaterUp, gtDrill, gtBallGun, gtBall, gtRCPlane, // 40
             gtSniperRifleShot, gtJetpack, gtMolotov, gtExplosives, gtBirdy, // 45
-            gtEgg, gtPortal, gtPiano, gtGasBomb, gtSineGunShot, gtHealthTag); // 51
+            gtEgg, gtPortal, gtPiano, gtGasBomb, gtSineGunShot); // 50
 
     // Gears that are _only_ of visual nature (e.g. background stuff, visual effects, speechbubbles, etc.)
     TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire,
--- a/hedgewars/uGears.pas	Fri May 14 16:02:27 2010 +0000
+++ b/hedgewars/uGears.pas	Fri May 14 23:42:56 2010 +0000
@@ -181,8 +181,7 @@
             @doStepPortalShot,
             @doStepPiano,
             @doStepBomb,
-            @doStepSineGunShot,
-            @doStepHealthTag
+            @doStepSineGunShot
             );
 
 procedure InsertGearToList(Gear: PGear);
@@ -298,10 +297,6 @@
 gtAmmo_Grenade: begin // bazooka
                 gear^.Radius:= 4;
                 end;
-   gtHealthTag: begin
-                gear^.Timer:= 1500;
-                gear^.Z:= 2002;
-                end;
        gtGrave: begin
                 gear^.ImpactSound:= sndGraveImpact;
                 gear^.nImpactSounds:= 1;
@@ -530,7 +525,7 @@
             t:= max(Gear^.Damage, Gear^.Health);
             Gear^.Damage:= t;
             if (cWaterOpacity < $FF) and (hwRound(Gear^.Y) < cWaterLine + 256) then
-                AddGear(hwRound(Gear^.X), min(hwRound(Gear^.Y),cWaterLine+cVisibleWater+32), gtHealthTag, t, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog; //spawnHealthTagForHH(Gear, t);
+                spawnHealthTagForHH(Gear, t);
             uStats.HedgehogDamaged(Gear)
             end;
 
@@ -594,8 +589,7 @@
                 not SuddenDeathDmg then
                 Gear^.State:= Gear^.State or gstLoser;
 
-            AddGear(hwRound(Gear^.X), hwRound(Gear^.Y) - cHHRadius - 12,
-                    gtHealthTag, dmg, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog; // spawnHealthTagForHH(Gear, dmg);
+            spawnHealthTagForHH(Gear, dmg);
 
             RenderHealth(PHedgehog(Gear^.Hedgehog)^);
             RecountTeamHealth(PHedgehog(Gear^.Hedgehog)^.Team);
@@ -915,10 +909,7 @@
            not CurrentHedgehog^.Gear^.Invulnerable then
            begin // this cannot just use Damage or it interrupts shotgun and gets you called stupid
            inc(CurrentHedgehog^.Gear^.Karma, tmpDmg);
-           
-           AddGear(hwRound(CurrentHedgehog^.Gear^.X),
-                   hwRound(CurrentHedgehog^.Gear^.Y),
-                   gtHealthTag, tmpDmg, _0, _0, 0)^.Hedgehog:= CurrentHedgehog; // spawnHealthTagForHH(CurrentHedgehog^.Gear, tmpDmg);
+           spawnHealthTagForHH(CurrentHedgehog^.Gear, tmpDmg);
            end;
         end;
     end;