hedgewars/HHHandlers.inc
changeset 868 4884bce5e5eb
parent 866 ac6f6c95c23f
child 876 d5b6e0ae5755
--- a/hedgewars/HHHandlers.inc	Thu Apr 24 15:40:39 2008 +0000
+++ b/hedgewars/HHHandlers.inc	Thu Apr 24 19:55:10 2008 +0000
@@ -162,11 +162,14 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepHedgehogDead(Gear: PGear);
+const frametime = 200;
+      timertime = frametime * 6;
 begin
 if Gear^.Timer > 1 then
 	begin
 	AllInactive:= false;
-	dec(Gear^.Timer)
+	dec(Gear^.Timer);
+	if (Gear^.Timer mod frametime) = 0 then inc(Gear^.Pos)
 	end else
 if Gear^.Timer = 1 then
 	begin
@@ -178,8 +181,12 @@
 	end else // Gear^.Timer = 0
 	begin
 	AllInactive:= false;
+	Gear^.Z:= cCurrHHZ;
+	RemoveGearFromList(Gear);
+	InsertGearToList(Gear);
 	PlaySound(sndByeBye, false);
-	Gear^.Timer:= 1100
+	Gear^.Pos:= 0;
+	Gear^.Timer:= timertime
 	end
 end;
 
@@ -510,12 +517,14 @@
 
 if (Gear^.Health = 0) then
 	begin
-	if AllInactive then
+	if PrvInactive then
 		begin
 		Gear^.Timer:= 0;
-		Gear^.doStep:= @doStepHedgehogDead
+		Gear^.State:= Gear^.State or gstHHDeath;
+		Gear^.doStep:= @doStepHedgehogDead;
+		PrvInactive:= false;
+		AllInactive:= false
 		end;
-	AllInactive:= false;
 	exit
 	end;