hedgewars/HHHandlers.inc
changeset 4365 4f2b1a152979
parent 4301 4866cc130b8d
child 4372 3836973380b9
--- a/hedgewars/HHHandlers.inc	Wed Nov 17 20:36:35 2010 +0300
+++ b/hedgewars/HHHandlers.inc	Wed Nov 17 20:58:23 2010 +0300
@@ -48,7 +48,7 @@
 ChangeAmmo:= false;
 slot:= Gear^.MsgParam;
 
-with PHedgehog(Gear^.Hedgehog)^ do
+with Gear^.Hedgehog^ do
     begin
     Gear^.Message:= Gear^.Message and not gmSlot;
     ammoidx:= 0;
@@ -60,7 +60,7 @@
 
     while (ammoidx < cMaxSlotAmmoIndex) and (Ammo^[slot, ammoidx].AmmoType <> CurAmmoType) do inc(ammoidx);
 
-    if ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) <> 0) and (MultiShootAttacks > 0) then OnUsedAmmo(PHedgehog(Gear^.Hedgehog)^);
+    if ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) <> 0) and (MultiShootAttacks > 0) then OnUsedAmmo(Gear^.Hedgehog^);
 
     MultiShootAttacks:= 0;
     Gear^.Message:= Gear^.Message and not (gmLJump or gmHJump);
@@ -101,7 +101,7 @@
     s: boolean;
 begin
 weap:= TAmmoType(Gear^.MsgParam);
-Hedgehog:= PHedgehog(Gear^.Hedgehog);
+Hedgehog:= Gear^.Hedgehog;
 
 if Hedgehog^.Team^.Clan^.TurnNumber <= Ammoz[weap].SkipTurns then exit; // weapon is not activated yet
 
@@ -118,15 +118,15 @@
         dec(t)
         end;
 
-if s then ApplyAmmoChanges(PHedgehog(Gear^.Hedgehog)^)
+if s then ApplyAmmoChanges(Gear^.Hedgehog^)
 end;
 
 procedure HHSetTimer(Gear: PGear);
 var CurWeapon: PAmmo;
 begin
 Gear^.Message:= Gear^.Message and not gmTimer;
-CurWeapon:= GetAmmoEntry(PHedgehog(Gear^.Hedgehog)^);
-with PHedgehog(Gear^.Hedgehog)^ do
+CurWeapon:= GetAmmoEntry(Gear^.Hedgehog^);
+with Gear^.Hedgehog^ do
     if (CurWeapon^.Propz and ammoprop_Timerable) <> 0 then
         begin
         CurWeapon^.Timer:= 1000 * Gear^.MsgParam;
@@ -143,9 +143,9 @@
     altUse: boolean;
 begin
 bShowFinger:= false;
-CurWeapon:= GetAmmoEntry(PHedgehog(Gear^.Hedgehog)^);
+CurWeapon:= GetAmmoEntry(Gear^.Hedgehog^);
 with Gear^,
-     PHedgehog(Gear^.Hedgehog)^ do
+     Gear^.Hedgehog^ do
      begin
      if ((State and gstHHDriven) <> 0)and
         ((State and (gstAttacked or gstHHChooseTarget)) = 0) and
@@ -386,7 +386,7 @@
 const frametime = 200;
       timertime = frametime * 6;
 begin
-if PHedgehog(Gear^.Hedgehog)^.Unplaced then exit;
+if Gear^.Hedgehog^.Unplaced then exit;
 if Gear^.Timer > 1 then
     begin
     AllInactive:= false;
@@ -406,7 +406,7 @@
     Gear^.Z:= cCurrHHZ;
     RemoveGearFromList(Gear);
     InsertGearToList(Gear);
-    PlaySound(sndByeBye, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack);
+    PlaySound(sndByeBye, Gear^.Hedgehog^.Team^.voicepack);
     Gear^.Pos:= 0;
     Gear^.Timer:= timertime
     end
@@ -417,7 +417,7 @@
 const frametime = 65;
       timertime = frametime * 11;
 begin
-if PHedgehog(Gear^.Hedgehog)^.Unplaced then exit;
+if Gear^.Hedgehog^.Unplaced then exit;
 if Gear^.Timer > 1 then
     begin
     AllInactive:= false;
@@ -434,7 +434,7 @@
     Gear^.Z:= cCurrHHZ;
     RemoveGearFromList(Gear);
     InsertGearToList(Gear);
-    PlaySound(sndByeBye, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack);
+    PlaySound(sndByeBye, Gear^.Hedgehog^.Team^.voicepack);
     PlaySound(sndWarp);
     Gear^.Pos:= 0;
     Gear^.Timer:= timertime
@@ -497,11 +497,11 @@
 var PrevdX: LongInt;
     CurWeapon: PAmmo;
 begin
-CurWeapon:= GetAmmoEntry(PHedgehog(Gear^.Hedgehog)^);
+CurWeapon:= GetAmmoEntry(Gear^.Hedgehog^);
 if ((Gear^.State and (gstAttacking or gstMoving)) = 0) then
    begin
    if isCursorVisible then
-      with PHedgehog(Gear^.Hedgehog)^ do
+      with Gear^.Hedgehog^ do
         with CurWeapon^ do
           begin
           if (Gear^.Message and gmLeft  ) <> 0 then
@@ -536,7 +536,7 @@
          Gear^.dY:= -_0_15;
          if not cArtillery then Gear^.dX:= SignAs(_0_15, Gear^.dX);
          Gear^.State:= Gear^.State or gstMoving or gstHHJumping;
-         PlaySound(sndJump1, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack);
+         PlaySound(sndJump1, Gear^.Hedgehog^.Team^.voicepack);
          exit
          end;
       end;
@@ -549,7 +549,7 @@
       Gear^.dY:= -_0_2;
       SetLittle(Gear^.dX);
       Gear^.State:= Gear^.State or gstMoving or gstHHJumping;
-      PlaySound(sndJump3, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack);
+      PlaySound(sndJump3, Gear^.Hedgehog^.Team^.voicepack);
       exit
       end;
 
@@ -570,7 +570,7 @@
       end;
    DeleteCI(Gear); // must be after exit!! (see previous line)
 
-   PHedgehog(Gear^.Hedgehog)^.visStepPos:= (PHedgehog(Gear^.Hedgehog)^.visStepPos + 1) and 7;
+   Gear^.Hedgehog^.visStepPos:= (Gear^.Hedgehog^.visStepPos + 1) and 7;
    if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then
       begin
       if not (TestCollisionXwithXYShift(Gear, _0, -6, hwSign(Gear^.dX))
@@ -630,7 +630,7 @@
 procedure HedgehogChAngle(Gear: PGear);
 var da: LongWord;
 begin
-with PHedgehog(Gear^.Hedgehog)^ do
+with Gear^.Hedgehog^ do
     if (CurAmmoType = amRope)
     and ((Gear^.State and (gstMoving or gstHHJumping)) = gstMoving) then da:= 2 else da:= 1;
 
@@ -649,7 +649,7 @@
 if Gear^.dX.QWordValue > 8160437862 then Gear^.dX.QWordValue:= 8160437862;
 if Gear^.dY.QWordValue > 8160437862 then Gear^.dY.QWordValue:= 8160437862;
 
-if PHedgehog(Gear^.Hedgehog)^.Unplaced then
+if Gear^.Hedgehog^.Unplaced then
    begin
    Gear^.dY:= _0;
    Gear^.dX:= _0;
@@ -773,7 +773,7 @@
     wasJumping: boolean;
     Hedgehog: PHedgehog;
 begin
-Hedgehog:= PHedgehog(Gear^.Hedgehog);
+Hedgehog:= Gear^.Hedgehog;
 if not isInMultiShoot then
    AllInactive:= false
 else
@@ -919,16 +919,16 @@
         PrvInactive:= false;
         AllInactive:= false;
 
-        if not PHedgehog(Gear^.Hedgehog)^.Team^.hasGone then
+        if not Gear^.Hedgehog^.Team^.hasGone then
             begin
-            PHedgehog(Gear^.Hedgehog)^.Effects[hePoisoned] := false;
-            if PHedgehog(Gear^.Hedgehog)^.Effects[heResurrectable] then begin
+            Gear^.Hedgehog^.Effects[hePoisoned] := false;
+            if Gear^.Hedgehog^.Effects[heResurrectable] then begin
                 ResurrectHedgehog(Gear);
             end else begin
                 Gear^.State:= Gear^.State or gstHHDeath;
                 Gear^.doStep:= @doStepHedgehogDead;
                 // Death message
-                AddCaption(Format(GetEventString(eidDied), PHedgehog(Gear^.Hedgehog)^.Name), cWhiteColor, capgrpMessage);
+                AddCaption(Format(GetEventString(eidDied), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage);
             end;
             end
         else
@@ -936,7 +936,7 @@
             Gear^.State:= Gear^.State or gstHHGone;
             Gear^.doStep:= @doStepHedgehogGone;
             // Gone message
-            AddCaption(Format(GetEventString(eidGone), PHedgehog(Gear^.Hedgehog)^.Name), cWhiteColor, capgrpMessage);
+            AddCaption(Format(GetEventString(eidGone), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage);
             end
         end;
     exit
@@ -974,7 +974,7 @@
     doStepHedgehogFree(Gear)
 else
     begin
-    with PHedgehog(Gear^.Hedgehog)^ do
+    with Gear^.Hedgehog^ do
         if Team^.hasGone then TeamGoneEffect(Team^);
     doStepHedgehogDriven(Gear)
     end;