hedgewars/HHHandlers.inc
changeset 5829 3ec95dc2b249
parent 5820 c9fe3b376a84
child 5830 ea4d1fe665d7
equal deleted inserted replaced
5827:a416f1070fdf 5829:3ec95dc2b249
  1032         Gear^.Timer:= 0;
  1032         Gear^.Timer:= 0;
  1033         FollowGear:= Gear;
  1033         FollowGear:= Gear;
  1034         PrvInactive:= false;
  1034         PrvInactive:= false;
  1035         AllInactive:= false;
  1035         AllInactive:= false;
  1036 
  1036 
  1037         if not Gear^.Hedgehog^.Team^.hasGone then
  1037         if (Gear^.State and gstHHGone) = 0 then
  1038             begin
  1038             begin
  1039             Gear^.Hedgehog^.Effects[hePoisoned] := false;
  1039             Gear^.Hedgehog^.Effects[hePoisoned] := false;
  1040             if Gear^.Hedgehog^.Effects[heResurrectable] then begin
  1040             if Gear^.Hedgehog^.Effects[heResurrectable] then begin
  1041                 ResurrectHedgehog(Gear);
  1041                 ResurrectHedgehog(Gear);
  1042             end else begin
  1042             end else begin
  1046                 AddCaption(Format(GetEventString(eidDied), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage);
  1046                 AddCaption(Format(GetEventString(eidDied), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage);
  1047             end;
  1047             end;
  1048             end
  1048             end
  1049         else
  1049         else
  1050             begin
  1050             begin
  1051             Gear^.State:= Gear^.State or gstHHGone;
       
  1052             Gear^.doStep:= @doStepHedgehogGone;
  1051             Gear^.doStep:= @doStepHedgehogGone;
  1053 
       
  1054             with Gear^.Hedgehog^.Team^ do
       
  1055                 for i:= 0 to cMaxHHIndex do
       
  1056                     if Hedgehogs[i].GearHidden <> nil then
       
  1057                         begin
       
  1058                         RestoreHog(@Hedgehogs[i]);
       
  1059                         if Hedgehogs[i].Gear <> nil then 
       
  1060                             begin
       
  1061                             Hedgehogs[i].Gear^.State:= Gear^.State or gstHHGone;
       
  1062                             Hedgehogs[i].Gear^.doStep:= @doStepHedgehogGone
       
  1063                             end
       
  1064                         end;
       
  1065 
  1052 
  1066             // Gone message
  1053             // Gone message
  1067             AddCaption(Format(GetEventString(eidGone), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage);
  1054             AddCaption(Format(GetEventString(eidGone), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage);
  1068             end
  1055             end
  1069         end;
  1056         end;
  1101 if (Gear^.State and gstHHDriven) = 0 then
  1088 if (Gear^.State and gstHHDriven) = 0 then
  1102     doStepHedgehogFree(Gear)
  1089     doStepHedgehogFree(Gear)
  1103 else
  1090 else
  1104     begin
  1091     begin
  1105     with Gear^.Hedgehog^ do
  1092     with Gear^.Hedgehog^ do
  1106         if Team^.hasGone then TeamGoneEffect(Team^);
  1093         if Team^.hasGone then 
  1107     doStepHedgehogDriven(Gear)
  1094             TeamGoneEffect(Team^)
       
  1095         else
       
  1096             doStepHedgehogDriven(Gear)
  1108     end;
  1097     end;
  1109 end;
  1098 end;