Remove all traces of dead code related to amStructure/gtStructure
authorWuzzy <Wuzzy2@mail.ru>
Sat, 10 Nov 2018 21:15:42 +0100
changeset 14217 ab5e710d353d
parent 14216 43ca01d4fb46
child 14218 3e551b0535fb
Remove all traces of dead code related to amStructure/gtStructure
hedgewars/uAIAmmoTests.pas
hedgewars/uGears.pas
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsHedgehog.pas
hedgewars/uGearsList.pas
hedgewars/uGearsRender.pas
hedgewars/uGearsUtils.pas
hedgewars/uTypes.pas
hedgewars/uVariables.pas
--- a/hedgewars/uAIAmmoTests.pas	Sat Nov 10 20:58:00 2018 +0100
+++ b/hedgewars/uAIAmmoTests.pas	Sat Nov 10 21:15:42 2018 +0100
@@ -119,7 +119,6 @@
             (proc: nil;              flags: 0), // amDrillStrike
             (proc: nil;              flags: 0), // amSnowball
             (proc: nil;              flags: 0), // amTardis
-            //(proc: nil;              flags: 0), // amStructure
             (proc: nil;              flags: 0), // amLandGun
             (proc: nil;              flags: 0), // amIceGun
             (proc: nil;              flags: 0), // amKnife
--- a/hedgewars/uGears.pas	Sat Nov 10 20:58:00 2018 +0100
+++ b/hedgewars/uGears.pas	Sat Nov 10 21:15:42 2018 +0100
@@ -1295,7 +1295,6 @@
             @doStepNapalmBomb,
             @doStepSnowball,
             @doStepSnowflake,
-            //@doStepStructure,
             @doStepLandGun,
             @doStepTardis,
             @doStepIceGun,
--- a/hedgewars/uGearsHandlersMess.pas	Sat Nov 10 20:58:00 2018 +0100
+++ b/hedgewars/uGearsHandlersMess.pas	Sat Nov 10 21:15:42 2018 +0100
@@ -128,7 +128,6 @@
 procedure doStepResurrectorWork(Gear: PGear);
 procedure doStepResurrector(Gear: PGear);
 procedure doStepNapalmBomb(Gear: PGear);
-//procedure doStepStructure(Gear: PGear);
 procedure doStepTardisWarp(Gear: PGear);
 procedure doStepTardis(Gear: PGear);
 procedure updateFuel(Gear: PGear);
@@ -6081,100 +6080,6 @@
     dec(Gear^.Timer)
 end;
 
-(*
-////////////////////////////////////////////////////////////////////////////////
-procedure doStepStructure(Gear: PGear);
-var
-    x, y: LongInt;
-    HH: PHedgehog;
-    t: PGear;
-begin
-    HH:= Gear^.Hedgehog;
-
-    if (Gear^.State and gstMoving) <> 0 then
-        begin
-        AddCI(Gear);
-        Gear^.dX:= _0;
-        Gear^.dY:= _0;
-        Gear^.State:= Gear^.State and (not gstMoving);
-        end;
-
-    dec(Gear^.Health, Gear^.Damage);
-    Gear^.Damage:= 0;
-
-    if Gear^.Pos = 1 then
-        begin
-        AddCI(Gear);
-        AfterAttack;
-        if Gear = CurAmmoGear then
-            CurAmmoGear:= nil;
-        if HH^.Gear <> nil then
-            HideHog(HH);
-        Gear^.Pos:= 2
-        end;
-
-    if Gear^.Pos = 2 then
-        begin
-        if ((GameTicks mod 100) = 0) and (Gear^.Timer < 1000) then
-            begin
-            if (Gear^.Timer mod 10) = 0 then
-                begin
-                DeleteCI(Gear);
-                Gear^.Y:= Gear^.Y - _0_5;
-                AddCI(Gear);
-                end;
-            inc(Gear^.Timer);
-            end;
-        if Gear^.Tag <= TotalRoundsPre then
-            Gear^.Pos:= 3;
-        end;
-
-    if Gear^.Pos = 3 then
-        if Gear^.Timer < 1000 then
-            begin
-            if (Gear^.Timer mod 10) = 0 then
-                begin
-                DeleteCI(Gear);
-                Gear^.Y:= Gear^.Y - _0_5;
-                AddCI(Gear);
-                end;
-            inc(Gear^.Timer);
-            end
-        else
-            begin
-            if HH^.GearHidden <> nil then
-                RestoreHog(HH);
-            Gear^.Pos:= 4;
-            end;
-
-    if Gear^.Pos = 4 then
-        if ((GameTicks mod 1000) = 0) and ((GameFlags and gfInvulnerable) = 0) then
-            begin
-            t:= GearsList;
-            while t <> nil do
-                begin
-                if (t^.Kind = gtHedgehog) and (t^.Hedgehog^.Team^.Clan = HH^.Team^.Clan) then
-                    t^.Hedgehog^.Effects[heInvulnerable]:= 1;
-                t:= t^.NextGear;
-                end;
-            end;
-
-    if Gear^.Health <= 0 then
-        begin
-        if HH^.GearHidden <> nil then
-            RestoreHog(HH);
-
-        x := hwRound(Gear^.X);
-        y := hwRound(Gear^.Y);
-
-        DeleteCI(Gear);
-        DeleteGear(Gear);
-
-        doMakeExplosion(x, y, 50, CurrentHedgehog, EXPLAutoSound);
-        end;
-end;
-*)
-
 ////////////////////////////////////////////////////////////////////////////////
 (*
  TARDIS needs
--- a/hedgewars/uGearsHedgehog.pas	Sat Nov 10 20:58:00 2018 +0100
+++ b/hedgewars/uGearsHedgehog.pas	Sat Nov 10 21:15:42 2018 +0100
@@ -501,7 +501,6 @@
                                  newGear:= AddGear(hwRound(lx), hwRound(ly), gtResurrector, 0, _0, _0, 0);
                                  newGear^.SoundChannel := LoopSound(sndResurrector);
                                  end;
-                    //amStructure: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtStructure, gstWait, SignAs(_0_02, dX), _0, 3000);
                        amTardis: newGear:= AddGear(hwRound(X), hwRound(Y), gtTardis, 0, _0, _0, 0);
                        amIceGun: newGear:= AddGear(hwRound(X), hwRound(Y), gtIceGun, 0, _0, _0, 0);
             end;
@@ -536,10 +535,9 @@
                    amSeduction, amBallgun,
                      amJetpack, amBirdy,
                 amFlamethrower, amLandGun,
-                 amResurrector, //amStructure,
-                      amTardis, amPiano,
-                      amIceGun, amRubber,
-                      amMinigun: CurAmmoGear:= newGear;
+                 amResurrector, amTardis,
+                       amPiano, amIceGun,
+                      amRubber, amMinigun: CurAmmoGear:= newGear;
             end;
             if CurAmmoType = amCake then FollowGear:= newGear;
             if CurAmmoType = amAirMine then newGear^.Hedgehog:= nil;
--- a/hedgewars/uGearsList.pas	Sat Nov 10 20:58:00 2018 +0100
+++ b/hedgewars/uGearsList.pas	Sat Nov 10 21:15:42 2018 +0100
@@ -98,7 +98,6 @@
 (*    gtPoisonCloud *) , amNothing
 (*       gtSnowball *) , amSnowball
 (*          gtFlake *) , amNothing
-//(*      gtStructure *) , amStructure  // TODO - This will undoubtedly change once there is more than one structure
 (*        gtLandGun *) , amLandGun
 (*         gtTardis *) , amTardis
 (*         gtIceGun *) , amIceGun
@@ -717,18 +716,6 @@
                 gear^.Radius:= 5;
                 gear^.Density:= _1_5;
                 end;
-{
-   gtStructure: begin
-                gear^.Elasticity:= _0_55;
-                gear^.Friction:= _0_995;
-                gear^.Density:= _0_9;
-                gear^.Radius:= 13;
-                gear^.Health:= 200;
-                gear^.Timer:= 0;
-                gear^.Tag:= TotalRoundsPre + 3;
-                gear^.Pos:= 1;
-                end;
-}
       gtIceGun: begin
                 gear^.Health:= 1000;
                 gear^.Radius:= 8;
--- a/hedgewars/uGearsRender.pas	Sat Nov 10 20:58:00 2018 +0100
+++ b/hedgewars/uGearsRender.pas	Sat Nov 10 21:15:42 2018 +0100
@@ -1570,7 +1570,6 @@
                         if Gear^.FlightTime > 0 then
                             untint;
                         end;
-       //gtStructure: DrawSprite(sprTarget, x - 16, y - 16, 0);
           gtTardis: if Gear^.Pos <> 4 then
                         begin
                         if Gear^.Pos = 2 then
--- a/hedgewars/uGearsUtils.pas	Sat Nov 10 20:58:00 2018 +0100
+++ b/hedgewars/uGearsUtils.pas	Sat Nov 10 21:15:42 2018 +0100
@@ -153,8 +153,7 @@
                 gtTarget,
                 gtFlame,
                 gtKnife,
-                gtExplosives: begin //,
-                //gtStructure: begin
+                gtExplosives: begin
 // Run the calcs only once we know we have a type that will need damage
                         tdX:= Gear^.X-fX;
                         tdY:= Gear^.Y-fY;
@@ -330,7 +329,6 @@
 			end
 	end
     end else
-    //else if Gear^.Kind <> gtStructure then // not gtHedgehog nor gtStructure
         Gear^.Hedgehog:= AttackerHog;
     inc(Gear^.Damage, Damage);
 
@@ -1218,8 +1216,7 @@
             gtKnife,
             gtCase,
             gtTarget,
-            gtExplosives: begin//,
-//            gtStructure: begin
+            gtExplosives: begin
 //addFileLog('ShotgunShot radius: ' + inttostr(Gear^.Radius) + ', t^.Radius = ' + inttostr(t^.Radius) + ', distance = ' + inttostr(dist) + ', dmg = ' + inttostr(dmg));
                     dmg:= 0;
                     r:= Gear^.Radius + t^.Radius;
@@ -1351,8 +1348,7 @@
             gtKnife,
             gtTarget,
             gtCase,
-            gtExplosives: //,
-            //gtStructure:
+            gtExplosives:
             begin
             if (Ammo^.Kind in [gtFirePunch, gtKamikaze]) and (Gear^.Kind <> gtSMine) then
                 PlaySound(sndFirePunchHit);
--- a/hedgewars/uTypes.pas	Sat Nov 10 20:58:00 2018 +0100
+++ b/hedgewars/uTypes.pas	Sat Nov 10 21:15:42 2018 +0100
@@ -108,7 +108,7 @@
             gtSniperRifleShot, gtJetpack, gtMolotov, gtBirdy, // 45
             gtEgg, gtPortal, gtPiano, gtGasBomb, gtSineGunShot, gtFlamethrower, // 51
             gtSMine, gtPoisonCloud, gtHammer, gtHammerHit, gtResurrector, // 56
-            gtNapalmBomb, gtSnowball, gtFlake, {gtStructure,} gtLandGun, gtTardis, // 61
+            gtNapalmBomb, gtSnowball, gtFlake, gtLandGun, gtTardis, // 61
             gtIceGun, gtAddAmmo, gtGenericFaller, gtKnife, gtCreeper, gtMinigun, gtMinigunBullet); // 68
 
     // Gears that are _only_ of visual nature (e.g. background stuff, visual effects, speechbubbles, etc.)
@@ -166,7 +166,7 @@
             amRCPlane, amLowGravity, amExtraDamage, amInvulnerable, amExtraTime, // 35
             amLaserSight, amVampiric, amSniperRifle, amJetpack, amMolotov, amBirdy, amPortalGun, // 42
             amPiano, amGasBomb, amSineGun, amFlamethrower, amSMine, amHammer, // 48
-            amResurrector, amDrillStrike, amSnowball, amTardis, {amStructure,} amLandGun, // 53
+            amResurrector, amDrillStrike, amSnowball, amTardis, amLandGun, // 53
             amIceGun, amKnife, amRubber, amAirMine, amCreeper, amMinigun); // 59
 
     // Different kind of crates that e.g. hedgehogs can pick up
@@ -489,7 +489,7 @@
             sidMolotov, sidBirdy, sidPortalGun, sidPiano, sidGasBomb,
             sidSineGun, sidFlamethrower,sidSMine, sidHammer, sidResurrector,
             sidDrillStrike, sidSnowball, sidNothing, sidTardis,
-            {sidStructure,} sidLandGun, sidIceGun, sidKnife, sidRubber, sidAirMine,
+            sidLandGun, sidIceGun, sidKnife, sidRubber, sidAirMine,
             sidCreeper, sidMinigun);
 
     TMsgStrId = (sidLoading, sidDraw, sidWinner, sidVolume, sidPaused,
--- a/hedgewars/uVariables.pas	Sat Nov 10 20:58:00 2018 +0100
+++ b/hedgewars/uVariables.pas	Sat Nov 10 21:15:42 2018 +0100
@@ -2277,35 +2277,6 @@
             ejectX: 0;
             ejectY: 0),
 
-// Structure
-{
-            (NameId: sidStructure;
-            NameTex: nil;
-            Probability: 0;
-            NumberInCase: 1;
-            Ammo: (Propz: ammoprop_ForwMsgs or
-                          ammoprop_NoCrosshair or
-                          ammoprop_Utility or
-                          ammoprop_DontHold;
-                Count: 1;
-                NumPerTurn: 0;
-                Timer: 0;
-                Pos: 0;
-                AmmoType: amStructure;
-                AttackVoice: sndNone;
-                Bounciness: defaultBounciness);
-            Slot: 6;
-            TimeAfterTurn: 0;
-            minAngle: 0;
-            maxAngle: 0;
-            isDamaging: false;
-            SkipTurns: 0;
-            PosCount: 1;
-            PosSprite: sprWater;
-            ejectX: 0;
-            ejectY: 0),
-}
-
 // Land Gun
             (NameId: sidLandGun;
             NameTex: nil;