adjust Z order so crosshairs are on top of hogs, grenades behind explosives
authornemo
Wed, 31 Aug 2011 01:17:14 -0400
changeset 5708 8972de340fa1
parent 5706 4454aa0523e7
child 5710 0fec06ac8776
adjust Z order so crosshairs are on top of hogs, grenades behind explosives
hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Wed Aug 31 00:58:48 2011 -0400
+++ b/hedgewars/uGears.pas	Wed Aug 31 01:17:14 2011 -0400
@@ -217,7 +217,6 @@
 gear^.doStep:= doStepHandlers[Kind];
 gear^.CollisionIndex:= -1;
 gear^.Timer:= Timer;
-gear^.Z:= cUsualZ;
 gear^.FlightTime:= 0;
 gear^.uid:= Counter;
 gear^.SoundChannel:= -1;
@@ -225,6 +224,8 @@
 gear^.nImpactSounds:= 0;
 // Define ammo association, if any.
 gear^.AmmoType:= GearKindAmmoTypeMap[Kind];
+if Ammoz[Gear^.AmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0 then gear^.Z:= cHHZ+1
+else gear^.Z:= cUsualZ;
 
 if CurrentHedgehog <> nil then
     begin
@@ -371,7 +372,8 @@
                 gear^.Elasticity:= _0_4;
                 gear^.Friction:= _0_995;
                 gear^.Density:= _6;
-                gear^.Health:= cBarrelHealth
+                gear^.Health:= cBarrelHealth;
+                gear^.Z:= cHHZ-1
                 end;
   gtDEagleShot: begin
                 gear^.Radius:= 1;