hedgewars/uGearsHedgehog.pas
changeset 13597 f7cbf7d8298d
parent 13568 470982c05f7e
child 13610 f1b6070a6e14
equal deleted inserted replaced
13596:7699987d9f70 13597:f7cbf7d8298d
   828                         end;
   828                         end;
   829                     end;
   829                     end;
   830      posCaseHealth: begin
   830      posCaseHealth: begin
   831                     PlaySound(sndShotgunReload);
   831                     PlaySound(sndShotgunReload);
   832                     inc(HH^.Health, Gear^.Health);
   832                     inc(HH^.Health, Gear^.Health);
       
   833                     // Prevent overflow
       
   834                     if (HH^.Health < 0) or (HH^.Health > cMaxHogHealth) then
       
   835                         HH^.Health:= cMaxHogHealth;
   833                     HH^.Hedgehog^.Effects[hePoisoned] := 0;
   836                     HH^.Hedgehog^.Effects[hePoisoned] := 0;
   834                     RenderHealth(HH^.Hedgehog^);
   837                     RenderHealth(HH^.Hedgehog^);
   835                     RecountTeamHealth(HH^.Hedgehog^.Team);
   838                     RecountTeamHealth(HH^.Hedgehog^.Team);
   836                     HHHeal(HH^.Hedgehog, Gear^.Health, true);
   839                     HHHeal(HH^.Hedgehog, Gear^.Health, true);
   837                     end;
   840                     end;