hedgewars/uGearsUtils.pas
changeset 13597 f7cbf7d8298d
parent 13572 a71e6856ffab
child 13604 73b096e1d895
equal deleted inserted replaced
13596:7699987d9f70 13597:f7cbf7d8298d
   288                 if vampDmg >= 1 then
   288                 if vampDmg >= 1 then
   289                     begin
   289                     begin
   290                     // was considering pulsing on attack, Tiy thinks it should be permanent while in play
   290                     // was considering pulsing on attack, Tiy thinks it should be permanent while in play
   291                     //CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State or gstVampiric;
   291                     //CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State or gstVampiric;
   292                     inc(CurrentHedgehog^.Gear^.Health,vampDmg);
   292                     inc(CurrentHedgehog^.Gear^.Health,vampDmg);
       
   293                     // Prevent overflow
       
   294                     if (CurrentHedgehog^.Gear^.Health < 0) or (CurrentHedgehog^.Gear^.Health > cMaxHogHealth) then
       
   295                         CurrentHedgehog^.Gear^.Health:= cMaxHogHealth;
   293                     RenderHealth(CurrentHedgehog^);
   296                     RenderHealth(CurrentHedgehog^);
   294                     RecountTeamHealth(CurrentHedgehog^.Team);
   297                     RecountTeamHealth(CurrentHedgehog^.Team);
   295                     HHHeal(CurrentHedgehog, vampDmg, true, $FF0000FF);
   298                     HHHeal(CurrentHedgehog, vampDmg, true, $FF0000FF);
   296                     end
   299                     end
   297                 end;
   300                 end;