hedgewars/VGSHandlers.inc
changeset 3459 c552aa44108d
parent 3443 14d12df0d363
child 3466 78d9fa9a700e
equal deleted inserted replaced
3458:11cd56019f00 3459:c552aa44108d
   428 
   428 
   429 ////////////////////////////////////////////////////////////////////////////////
   429 ////////////////////////////////////////////////////////////////////////////////
   430 procedure doStepHealthTagWork(Gear: PVisualGear; Steps: Longword);
   430 procedure doStepHealthTagWork(Gear: PVisualGear; Steps: Longword);
   431 begin
   431 begin
   432 if Steps > Gear^.Timer then
   432 if Steps > Gear^.Timer then
   433     begin
   433     DeleteVisualGear(Gear)
   434     DeleteVisualGear(Gear);
       
   435     end
       
   436 else
   434 else
   437     begin
   435     begin
   438     dec(Gear^.Timer, Steps);
   436     dec(Gear^.Timer, Steps);
   439     Gear^.Y:= Gear^.Y + Gear^.dY * Steps;
   437     Gear^.Y:= Gear^.Y + Gear^.dY * Steps;
   440     end;
   438     end;
   455 s:= '';
   453 s:= '';
   456 
   454 
   457 Gear^.dY:= -_0_08;
   455 Gear^.dY:= -_0_08;
   458 
   456 
   459 str(Gear^.State, s);
   457 str(Gear^.State, s);
   460 Gear^.Tex:= RenderStringTex(s, PHedgehog(Gear^.Hedgehog)^.Team^.Clan^.Color, fnt16);
   458 if Gear^.Hedgehog <> nil then
   461 // if you segfault here you probably added this healthtag directly
   459     Gear^.Tex:= RenderStringTex(s, PHedgehog(Gear^.Hedgehog)^.Team^.Clan^.Color, fnt16)
   462 // maybe you should call spawnHealthTagForHH() in uGears.pas instead
   460 else
       
   461     Gear^.Tex:= RenderStringTex(s, cWhiteColor, fnt16);
   463 
   462 
   464 if hwRound(Gear^.Y) < cWaterLine then
   463 if hwRound(Gear^.Y) < cWaterLine then
   465     Gear^.doStep:= @doStepHealthTagWork
   464     Gear^.doStep:= @doStepHealthTagWork
   466 else
   465 else
   467     Gear^.doStep:= @doStepHealthTagWorkUnderWater;
   466     Gear^.doStep:= @doStepHealthTagWorkUnderWater;