hedgewars/uGears.pas
changeset 3831 3410db7ac43e
parent 3799 5341dc5a8919
child 3832 f949798219bf
equal deleted inserted replaced
3830:5c7af1bf692a 3831:3410db7ac43e
  1550     end;
  1550     end;
  1551 CountGears:= count;
  1551 CountGears:= count;
  1552 end;
  1552 end;
  1553 
  1553 
  1554 procedure ResurrectHedgehog(gear: PGear);
  1554 procedure ResurrectHedgehog(gear: PGear);
       
  1555 var tempTeam : PTeam;
  1555 begin
  1556 begin
  1556     gear^.dX := _0;
  1557     gear^.dX := _0;
  1557     gear^.dY := _0;
  1558     gear^.dY := _0;
  1558     gear^.State := gstWait;
  1559     gear^.State := gstWait;
  1559     uStats.HedgehogDamaged(gear);
  1560     uStats.HedgehogDamaged(gear);
  1562     with CurrentHedgehog^ do begin
  1563     with CurrentHedgehog^ do begin
  1563         inc(Team^.stats.AIKills);
  1564         inc(Team^.stats.AIKills);
  1564         if Team^.AIKillsTex <> nil then FreeTexture(Team^.AIKillsTex);
  1565         if Team^.AIKillsTex <> nil then FreeTexture(Team^.AIKillsTex);
  1565         Team^.AIKillsTex := RenderStringTex(inttostr(Team^.stats.AIKills), Team^.Clan^.Color, fnt16);
  1566         Team^.AIKillsTex := RenderStringTex(inttostr(Team^.stats.AIKills), Team^.Clan^.Color, fnt16);
  1566     end;
  1567     end;
       
  1568     tempTeam := PHedgehog(gear^.Hedgehog)^.Team;
  1567     FindPlace(gear, false, 0, LAND_WIDTH); 
  1569     FindPlace(gear, false, 0, LAND_WIDTH); 
  1568     RenderHealth(PHedgehog(gear^.Hedgehog)^);
  1570     if gear <> nil then begin
  1569     RecountTeamHealth(PHedgehog(gear^.Hedgehog)^.Team);
  1571         RenderHealth(PHedgehog(gear^.Hedgehog)^);
  1570     ScriptCall('onResurrect', gear^.uid);
  1572         ScriptCall('onResurrect', gear^.uid);
       
  1573     end;
       
  1574     RecountTeamHealth(tempTeam);
  1571 end;
  1575 end;
  1572 
  1576 
  1573 function SpawnCustomCrateAt(x, y: LongInt; crate: TCrateType; content: Longword): PGear;
  1577 function SpawnCustomCrateAt(x, y: LongInt; crate: TCrateType; content: Longword): PGear;
  1574 begin
  1578 begin
  1575     FollowGear := AddGear(x, y, gtCase, 0, _0, _0, 0);
  1579     FollowGear := AddGear(x, y, gtCase, 0, _0, _0, 0);